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
FreddySFreddyS 

Prepopulate custom lightning lookup

Hey! can someone help point me in the right direction onn how to pre-populate this custom lookup component based on the account record page its on? If I put this component on account lightning pages, I would like the component to be populated with the account name from the current record! Thanks everyone!
http://sfdcmonkey.com/2017/07/17/re-usable-custom-lookup/
Saravanan RajarajanSaravanan Rajarajan
Hi,

Please Peste it below piece of code in your requirement:

Sytex of pre-populate this custom lookup component
 
createRecordEvent.setParams({
            'entityApiName': Account,
                        
            'defaultFieldValues': {                              
                'Name':'Account.Name',
                   //populating few field values
            }                
        });

Please mark it best answer if it helps you.
FreddySFreddyS
Thanks Saravanan! Where should this code go? In what component/ what contoller or helper?