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
SFDC ADM 7SFDC ADM 7 

Auto populate values from another object

Hi All,
I am new to lightning
I have two fields on UI.
both are look up. If I select one value in first field. I want to auto populate second field. Each record in first object have only one related record in second object.

How can I do this in Lightning?
Please help me
Thanks in Advance
 
Srinivasa Chary TaduriSrinivasa Chary Taduri
Use JQuery or Javascript. Get the the two fields Id's using inspect element. Populate the second field based on the first field.
SFDC ADM 7SFDC ADM 7

Hi Srinivasa,
Thank you for answer

can you please give me some sysntax?
It will be more helpfull

David HalesDavid Hales
Hi SFDC ADM 7,
Lets assume you have 2 fields on account object (fields - PNO, AcctNo)
and you second object opportunity so flow this,
Create formula fields (text) for PNO and AcctNo in opportunity object. It will automatically gets populated on selecting account from opportunity.
 
Try out the following formula:
 
Account__r.PNO and Account__r.AcctNo

If the above suggestion worked, let us know by marking the answer as "Best Answer" right under the comment which will help the rest of the community should they have a similar issue in the future. 

Thanks & Regards 
David Hales(1053)
Kloudrac Software Pvt. Ltd.