lightning Readiness check tells you that if you have any buttons based on URL hacks will not be supported in Lightning Experience. For example, If you are using any button of type URL to pre-populate some values from Parent record, They might not work in Lightning.
Let’s say, On Account record page, You are having URL button to pre-populate some field values using URL hacks. They will not work in Lightning.
You might be looking for the option that will be supported in Lightning Experience. The quick action will come to rescue you in such situations.
The quick actions are of different type but we will mainly discuss about the object specific quick actions as URL hacks are also object specific.
- Object-specific actions can update records.
- Object-specific actions can create records that are automatically associated with related information. For example, a user could initiate an action that simultaneously creates a contact and associates it with an account.
Steps to create Object-specific action
- On object manager page of an object, Go to Buttons, Links, and Actions and click New Action.
- Verify that the action type is Create a Record. (Note: Actions can do more than just create records.)
- In the Target Object dropdown list, select the object name to create record with pre-populated values.
- Enter your desired name in the Label field.
- Click Save .
- In the layout editor, Add your minimal required fields to create a record
- Click Save
Here, we have created one action on Account to create a record of Object Opportunity associated with account with auto population of Account description on Opportunity description. In order to pre-populate, We need to set pre-defined values to account and description fields dynamically.
Steps to Set Predefined Field Values for Quick Action Fields
- Click the name of an action in the Buttons, Links, and Actions list or the Global Actions list.
- On the action detail page, click New in the Predefined Field Values list.
- Select the field you want to predefine a value for.
- Specify the value for the field.For single-select picklists, you can specify both a specific value and a formula value. If you set both, the formula value takes precedence over the specific value.
- Click Save.
Here, We have set the pre-defined value for description field of Opportunity by referencing the account description fields. I have added screenshots for description, but you need to set the pre-defined value for Account Name field of Opportunity to associate it with an Account.
Its time to add the action on the related list of Account. Go to Object Manager of Account object and select Page layout and edit the page the layout assigned to you. Add the newly created action to Salesforce Mobile and Lightning Experience Actions section and save your layout.
Everything is set now. You can check your Action now. Navigate to an account record and you will see your button on the Highlight panel.
When you click on that button, A Popup will appear with description and Account field of Opportunity auto-populated from the current Account record as below.
This way, you get an alternative to eliminate your URL hacks used in Classic.
- Salesforce Mobile App Customization
- Set Predefined Field Values for Quick Action Fields
- Notes on Predefined Field Values for Quick Actions