You need to sign in to do that
Don't have an account?
Lalitha Jakka 18
account related order, opportunity in LWC
I have an object called Invoice, which has account, order, and opportunity as lookup fields. I have overridden the Inoice New button, on new invoice record creation, when I select Account, respective order and opportunity records want to show in the lookup fields to select.
Currently, I am using
<lightning-input-field field-name="Order__c" onchange={handleOrderSelection}></lightning-input-field>
where it displays record records
Thanks in Advance !!
Currently, I am using
<lightning-input-field field-name="Order__c" onchange={handleOrderSelection}></lightning-input-field>
where it displays record records
Thanks in Advance !!
Are you facing any Error or the records are not showing up ?
Can you please elaborate.
Thank you.
To achieve this, you're currently using the Lightning input field component with the "Order__c" field name and an "onchange" event handler called "handleOrderSelection". This component displays the related Order records based on the selected Account.
Is there anything else you need help with related to this topic?
@Subrat
No, I am not facing any issues but when I select an account, in order lookup field, it shows recent records instead of account related order records
No, I am not getting related records, it shows recent records
formfill.html
After speaking with Danielle, “Amount”, “Next Steps”, and “Stage” are the three key fields that the team are constantly updating, so we add these fields as inputs. Let’s add “Opportunity Name” as an output as well, just for the visual. MyBalanceNow (https://www.mybalancenow.page/)
<template>
<lightning-quick-action-panel header="Edit Fields Action">
<lightning-record-edit-form record-id={recordId}
object-api-name={objectApiName}
onsuccess={handleSuccess}>
<lightning-output-field field-name="Name"></lightning-output-field>
<lightning-input-field field-name="Amount"></lightning-input-field>
<lightning-input-field field-name="NextStep"></lightning-input-field>
<lightning-input-field field-name="StageName"></lightning-input-field>
<lightning-button variant="neutral" label="Cancel"></lightning-button>
<lightning-button variant="brand" class="slds-m-left_x-small" label="Save" type="submit"></lightning-button>
</lightning-record-edit-form>
</lightning-quick-action-panel>
</template>