Prepopulate the lookup field value in salesforce standard view page using URL Parameters?

Its possible using the below workaround:

First you need to get the Lookup Field 15 digit Salesforce ID:

For Example:
Contact is a lookup field in any of the custom object, so get the contact lookup id value from browser:

so here 00NU0000004EFhv (Lookup field id)

in your parameter you need to populate the parameters with value like:
The parameter to use for the Id of the record (CONTACT ID) CF00NU0000004EFhv=15 digit Contact ID.
The parameter to use for the Name of the record (CONTACT NAME) CF00NU0000004EFhv_lkid=Contact Name Contact ID.

This parameter is always prefixed with the characters “CF” and it always ends with the characters “_lkid”

so finally using button/controller then override your url like:

How to get the Standard/Custom Field Id?
by navigating to the field in setup. For example, if you want to prepopulate ObjectDetail_c.TextField_c, you would go to Setup => Create => Objects => ObjectDetail => TextField, which takes me to to the URL


Written by 

2x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published. Required fields are marked *