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
SF_Admin96SF_Admin96 

Pre Populate field based on the lookup value entered.

Hi All,

I would like to know how can I pre-populate fields based on the lookup value being entered by a user?

For example: I have three fields and those values will be coming from the Parent Object. Whatever value is being entered in the lookup field, it should pre-populate the values on the three fields BEFORE saving the record. How do I do that? I believe it can only be done using APEX.

Is there anyone here tried that? Would you be able share some samples codes please?

Thank you in advance.
kaustav goswamikaustav goswami
Is the UI a visualforce page?
AshwaniAshwani
If it is visualforce page then you can find required sObject instance lookup filed with <apex:inputfield> and add a onchange actionsuppoert with so when the value of lookup get changed you query result according to it and fill all other fields by rerendering it.
SF_Admin96SF_Admin96
Hi All,

It is not a VF, just a standard UI. Can it be done using standard UI? If not, do you guys have sample codes to share. 

Thanks.