create record with pre-populated values in lex

the documentation on this spring20 feature is so bad its almost like it doesnt exist at all.

this is all you get - one example and 2 notes

Screenshot from 2021-10-05 10-02-26.png

some missing ‘details’

a) date fields need to be converted to string using the TEXT formula

b) you can pass RecordTypeId (case sensitive) via a separate url parameter, but not in the default field values. the docs just say its not supported yet and strange things may happen. what is the point of having this feature without supporting record types? insert snide remark about confetti here.

example

/lightning/o/Opportunity/new?recordTypeId=012400000009dr3&defaultFieldValues=...\

c) the nooverride=1 parameter works in lex. if you have overridden the ‘new’ button on the object with say a visualforce page for example so people can only create opps from contacts or accounts, you can pass nooveride=1 and it will let you bypass that page.

d) you can pass ContactId when creating an opp to create an opportunity contact role. (this is just another field on the opp object so its not special per se, but it kinda is)

and finally that you can create buttons / links that work in classic and lex. tho url hacks in classic are not officially supported, but c'mon now its like jaywalking, everyone does it.

so while it took way too much time i was finally able to create a custom button on contact that creates an opp and pre-sets the record type and creates the contact role. while i love flow, i did not love rebuilding this whole thing in flow, and now i can switch back to the button.

 
0
Kudos
 
0
Kudos

Now read this

Flow to check and redirect to create / edit if…

Scenario: Check if record (meeting certain criteria) already exists, if not redirect to standard create new page, else redirect to view record Example: client services - wants all records for a client from a single day under a single... Continue →