0

I have created a custom URL button with default values to create a Lead from a Contact. I'm unable to map Lastname and email field values from contact to Lead.

Can anyone help with this?

lightning/o/Lead/new?recordTypeId=0125i0000000ZL6AAM&defaultFieldValues=
FirstName={!Contact.FirstName},
MiddleName={!Contact.MiddleName}
LastName ={!Contact.LastName},
Email ={!Contact.Email},
MobilePhone={!Contact.MobilePhone}

I tried this too

LastName ={!URLENCODE(Contact.LastName)},
Email ={!URLENCODE(Contact.Email)}

1 Answer 1

0

After adding nooverride=true to the URL for me I am able to populate LastName and Email fields on Lead.

/lightning/o/Lead/new?nooverride=true&defaultFieldValues=
FirstName={!Contact.FirstName},
Email ={!Contact.Email},
MobilePhone={!Contact.MobilePhone},
LastName={!Contact.LastName},
Email={!Contact.Email}

As per Salesforce documentation recordtypeId is not yet supported but it seems it is working as per this post.

NOTE Passing the RecordTypeId to defaultFieldValues isn’t yet supported. The recordTypeId influences routing behavior, layout assignment, and page assignment, so you can see unexpected results if you try to use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.