1

I have two object one is Mandate__c and another one is Literature_distribution__c ,, in which i have one button with URL on the mandate to create the literature_distribution.....I jst need to copy the mandate record id from which the button is clicked should be default populated on the literature distribution page layout before creation.

for ex: Mandate_Name__c is lookup on the Literature_distribution__c ,, if user clicks on the MandateA(record) then on the Page layout it should be prepopulated on the Mandate_name__c..

below is the formula i tried : Value is not getting prepopulated , kindly help:

    /lightning/o/Literature_Distribution__c/new?&recordTypeId=01220000000AJdiAAG& defaultFieldValues=Literature_Distribution__c={!Literature_Distribution__c.RecordTypeId},
{! Literature_Distribution__c.Mandate_Name__c }={!Mandate__c.Id}

1 Answer 1

1

Seems like default value for lookup field are not supported.

Check this:

https://trailblazer.salesforce.com/ideaView?id=087300000007Pid

Check comment on my answer on below link in which user face similar issue with lookup field for URL hack:

How to use URL hack in lightning to clone all fields EXCEPT recordtype, which i want to change

suggested workaround by him

created formula fields that take the id of the lookup fields and prepopulated with those formulas

Update:

I replicated this:

this seems working:

/lightning/o/Literature_distribution__c/new? &defaultFieldValues=Mandate_Name__c={!Mandate__c.Id}

6
  • can you please explain a bit...formula fields needs to be created on Source ???
    – user102120
    Aug 26, 2021 at 9:41
  • yes ..and that field will hold the Id of lookup field, in URL hack you have to map this formula field value instead of lookup. Aug 26, 2021 at 10:20
  • If earlier it was something like this InsuranceCompany__c={!Lead.InsuranceCompany__c} now it can be InsuranceCompany__c={!Lead.FormulaField__c} Aug 26, 2021 at 10:26
  • can some one please give the straight forward answer?
    – user102120
    Aug 27, 2021 at 5:21
  • I tried with the Formula field it is not working..kindly suggest another approach.
    – user102120
    Aug 27, 2021 at 7:30

You must log in to answer this question.