I have an object called Opener__c. And I have a second object called Underwriting__c. In Underwriting__c object I have a lookup field Account__c which is a relationship to the Opener__c object. When I'm creating new Underwriting__c record, I want to copy data from the Opener__c object.

So the question is: When I open the page for creating new Underwriting__c record I want to see fields populated with data from the Opener__c record.

I tried using triggers (before insert, before update) and when I click New button to create new Underwriting__c record I see page with fields to input data. And when I click save and my page refreshes I see that all fields are populated with data. But I want to populate data in fields on the page before I click save button.

  • You're going to need to associate the fields and then run an Action or a JS script after linking up the Account and the Underwriting record to the Opener record you want to pre-populate if you don't want to do this in a Trigger. – crmprogdev Apr 7 '17 at 17:27

If you want to populate the fields on the create/edit page of the underwriting object I believe this would require a custom VF page. The <apex:page> action method could fire a controller method to collect data you want to copy over from the related Account object and place it as values in the corresponding input fields for the new object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.