Set Record Type Id, Date value, Enforce to Record Type selection, Date field values in Records Create Page with Default Field Values – Spring 20

This post & video describes about to set Default values, Set the Record Type Id, Enforce user to select the Record Type value selections from popup, Pass the Date value using defaultFieldValues. As part of Spring 20 Release its possible to construct the formula to prepopulate the values while creating a new record using custom button or custom links.

As part of Spring 20 Salesforce Release, URL Hacking is back in Salesforce Lightning Experience.

Refer my previous post URL hacking is back in Salesforce Lightning Experience as part of Spring 20 Release:- http://theblogreaders.com/url-hacking-back-salesforce-lightning-experience-spring-20-release/

 

To Show Record Type Selection in Record’s Create Page with Default Field Values:-

/lightning/o/Contact/new?useRecordTypeCheck=1

Set Default Record Type value in Record’s Create Page with Default Field Values:-

Note: recordTypeId   (here recordTypeId  follow the case sensitive i.e T and I capital letters)

/lightning/o/Contact/new?recordTypeId=0122v000001SmZ2AAK&
defaultFieldValues=
LastName={!URLENCODE(Account.Name)},
Phone={!Account.Phone},
Languages__c=English

Set Date field values in Record’s Create Page with Default Field Values:-

/lightning/o/Contact/new?recordTypeId=0122v000001SmZ2AAK&
defaultFieldValues=
LastName={!URLENCODE(Account.Name)},
Phone={!Account.Phone},
DateOfBirth__c={!TEXT(TODAY() )}

To pass the date value to convert as String value using TEXT() – https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_lc_navigate_to_record_dfv.htm

Demo Video:

Prepopulate Field values in Lightning Experience Using defaultFieldValues – Spring 20

This video demonstrate following items:-

  • Set Record Type Id Using defaultFieldValues – Spring 20
  • Enforce User to Select Record Types Using defaultFieldValues – Spring 20
  • Set Date value Using defaultFieldValues – Spring 20
  • Set Custom field value Using defaultFieldValues – Spring 20

Final Notes:-

  • Use URLENCODE if your passing values contain any special characters
  • Remove the Space between your field API Name and Value
  • Use useRecordTypeCheck or recordTypeId before the defaultFieldValues
  • Case Sensitive for recordTypeId
  • Date to Convert as String Using TEXT()

Reference:

URL Hacking is back in Salesforce Lightning Experience – Spring 20 Release

Written by 

Salesforce MVP | Lightning Champion | 17x Salesforce Certified | Application Architect | 7x Trailhead Ranger | Techforce Services | Australia

Leave a Reply

Your email address will not be published. Required fields are marked *

*