1

I want to add a button on the related list to create a new record with some prepopulated default value in the standard "Name" field. I'm looking at the release notes from Spring 2020 which says it is now supported in Lightning but I'm unable to prepopulate values.

Here is the release notes link: https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_general_lex_navigate_to_record_dfv.htm

I'm adding a button on a custom object where I want "Name" field to be prepopulated with "Account Name" (where Account is parent). Here is my button URL:

/lightning/o/CustomObject__c/new?defaultFieldValues=
Name={!Account.Name},
Client__c={!Account.Id}

When I add button on the related list on Account Page, I'm still not able to prepopulate Name field. I do not want to hardcode Account Id. What am I missing here?

1 Answer 1

3

Remove the line breaks. It's not called out in the release notes and examples always seem to show line breaks (for readability) but line breaks do not work.

/lightning/o/CustomObject__c/new?defaultFieldValues=Name={!Account.Name},Client__c={!Account.Id}}

This is called out in this article, but I've also run into the same issue.

enter image description here

2
  • Thanks, it works :)
    – user569925
    Commented Sep 8, 2020 at 15:17
  • Really annoying it's not called out. If anyone finds an official doc that mentions this, please let me know and I can edit it in. Commented Sep 8, 2020 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .