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:
https://my.salesforce.com/00NU0000004EFhv?setupid=CustomObjects

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:
“https://my.salesforce.com/a08/e?CF00NU0000004EFhv={!Contact.Name}&CF00NU0000004EFhv_lkid={!Contact.Id}”

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 

I am Sakthivel Madesh, a certified Salesforce Advanced Developer & Administrator working on Salesforce Technology since 2011. I am currently working in Techforce Services as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 15x Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead 5x Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply

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

*