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
Michael MMichael M 

Help with URL hack in lightning

Hello, I am trying to create a custom button using a URL hack, which prepopulates values. I am starting with a few values, but it does not seem to be working. When i click my button, the name fields and ownerid field do not follow the  Lead from which I am pressing the button. Can anybody show me what I need to change in my code to make this work?

Here is the url code I am using for the custom button:

/lightning/o/Lead/new?recordTypeId=0121N0000012oypQAA&
defaultFieldValues=
name='{!Lead.Name}',
firstname={!Lead.FirstName},
lastname={!Lead.LastName},
OwnerId={!Lead.OwnerId}

 
JonathanFoxJonathanFox
Make sure you have removed your line breaks
Michael MMichael M
Hi JonathanFox, I just tried with removing line breaks but it still is not prepopulating any of the fields. Here is what i used:
/lightning/o/Lead/new?recordTypeId=0121N0000012oypQAA&defaultFieldValues=name='{!Lead.Name}',firstname{!Lead.FirstName},lastname={!Lead.LastName},OwnerId={!Lead.OwnerId}