function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AkhileshSinghAkhileshSingh 

pre populate the value on custom lightning look up on lightning page

Hi ,
I  am using custom account lookup on lightning  page (this look up is using inside quick action of opportunity page.).I have another standard account lookup on opportunity detail page. I want to prepopulate the value of standard acccount look up   on custom  account lookup  on lightning  page.
so whenever i change the value of standard account look up on opportunity  detail page .that value is reflect on custom lightning look up.

I am using code for custom account  lookup 
https://sfdcmonkey.com/2017/07/17/re-usable-custom-lookup/


 
Danish HodaDanish Hoda
hi Akhilesh,
Use doInit() method on lightning component on load to get the data Standard lookup data on the custom one.
AkhileshSinghAkhileshSingh
Hi Danish ,

I  am  calling below custom account look up 
 <c:AccountLookup objectAPIName="account" IconName="standard:account" label="Account Name" selectedRecord={!v.selectedLookUpRecord}"/>


In DOiNit :
if(responsevalue[0].Partner__c)
                    {
                        var partnerName = responsevalue[0].Partner__r.Name;
                        component.set("v.selectedLookUpRecord",partnerName);
                        
                        
                    }

but still value is not prepopulate on custom Account look up .
Danish HodaDanish Hoda
hi Akhilesh,
This won't work as selectedLookUpRecord is setting late as compared with the modal iteself and you won't be able to refrsh the modal view once your attribute is set.

What you can do is a workaround : Use aura:if to show the Account name as text if Standard lookup has a value, and use an inline edit utility button which when clicked, your custom lookup component appears.