0

I have master detail relationship between Opportunity and Work Order. There is Work Order related list in Opportunity. On clicking 'New' in related list, I want to prepopulate some fields using Opportunity values in lightning. The user must be able to change the predefined values if needed.

On researching, I found out that it can be done using Quick Actions. More information. The problem is that I won't be able to use the 'New' button of related list to create new Work Order if I am using Quick Action. Also, I won't be able to use the existing page layout.

I was looking into other ways to prepopulate field values while creating a record but did not find any. Did I miss something? Please guide.

Thank You.

1 Answer 1

0

URL hacking can be used to achieve the functionality. Check the release notes.

Code:

/lightning/o/Account/new?defaultFieldValues=
    Name={!URLENCODE(Account.Name)},
    OwnerId={!Account.OwnerId},
    AccountNumber={!Account.AccountNumber},
    NumberOfEmployees=35000,
    CustomCheckbox__c={!IF(Account.SomeCheckbox__c, true, false)}

Note that there should not be spaces or carriage returns in the URL.

Detailed explanation.

You must log in to answer this question.

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