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
Sam Wilson 16Sam Wilson 16 

Custom button URL hack - can prepopulate other lookup fields but not contact on custom object

We have a custom object called Feedback that has lookups to both Contacts and Opportunities. Feedback records are created from Opportunities using a custom button URL hack.

The custom button populates the Opportunity lookup and Date fields on a new Feedback record but won't populate the Contact lookup.

The Contact entry should be coming from the custom lookup field on Opportunities called Primary Contact (which is auto-populated with the Primary Contact Role using flows).

My custom button URL is
/a0V/e? 
CF00N6E000000h3Cz={!Opportunity.Primary_Contact__c}
&CF00N6E000000h3Cz_lkid={!Opportunity.Primary_ContactId__c} 
&00N6E000000h2HU={!TODAY()} 
&CF00N6E000000h2ID={!Opportunity.Name} 
&CF00N6E000000h2ID_lkid={!Opportunity.Id} 
&retURL=%2F{!Opportunity.Id}

Any help would be greatly appreciated!
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Sam,
  • You can pre-populate any field using custom URLs   
http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html

Thanks
Rahul Kumar
Sam Wilson 16Sam Wilson 16
Thanks for replying but posting that link doesn't provide anything further to the URL button I've already created.
Marilyn BureshMarilyn Buresh
I have a custom URL very similar to this. It prepopulates 2 lookup fields to related objects...but the prepopulating doesn't work in Lightning. Any idea how to edit it to work for LEX?
Kausar ShaikhKausar Shaikh
Marilyn Buresh, We have a similar URL hack in classic prepopulating two lookup fields on an object. Were you able to figure out a workaround?
 
Marilyn BureshMarilyn Buresh
Sometimes I was able to create an action and use pre-defined fields. Unfortunately in this specific example though, that did not work.
Kausar ShaikhKausar Shaikh
Marilyn, Thanks for your response.I think we may have to do the same replace wherever we can with quick actions.