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
Alfia Quadri 11Alfia Quadri 11 

URL Hacking Custom look up field NOT PREPOPULATING

In opportunities object, I have a custom parent opportunity field.
I created a button using url hacking called Renew. On clicking the button It is not populating the parent opportunity field.
/lightning/o/Opportunity/new?defaultFieldValues=AccountId={!Opportunity.AccountId},Product_Type__c={!Opportunity.Product_Type__c},CF00N5600000LtmFR={!Opportunity.Name},CF00N5600000LtmFR_lkid={!Opportunity.Id}

I tried different ways

/lightning/o/Opportunity/new?defaultFieldValues=AccountId={!Opportunity.AccountId},Product_Type__c={!Opportunity.Product_Type__c},{!Opportunity.Parent_OpportunityId__c}={!Opportunity.Id}


 
VinayVinay (Salesforce Developers) 
Hi Alfia,

You would need to hard code lookup field id in URL, check below reference for same.

http://theblogreaders.com/custom-button-url-hacking-salesforce-lightning-experience-vs-salesforce-classic/
https://salesforce.stackexchange.com/questions/319253/lightning-url-hack-for-lookup-field

Please mark as Best Answer if above information was helpful.

Thanks,