Replacing the ‘New’ Opportunity Button on a Contact with a Screen Flow
Description:
An organization seeks to replace the standard ‘New’ button on the Opportunity related list in Contact records with a custom flow. This flow will allow them to create an Opportunity record with additional customization that the standard screen does not offer.
Solution:
In this guide, we’ll walk through the steps to replace the standard ‘New’ button with a custom flow that the admin has already created.
Note: This guide assumes the Flow for creating an Opportunity record is already in place. We will focus on how to replace the standard ‘New’ button with this Flow on the Opportunity related list.
Steps to Implement:
- Log in to Salesforce
- Click the Gear icon in the top right corner.
- Select Setup from the dropdown menu.
- Access the Opportunity Object in Object Manager
- Navigate to the Object Manager tab.
- Search for and select the Opportunity object.
- Create a Custom Button
- Under Buttons, Links, and Actions, click on New Button or Link.
- Fill in the fields as follows:
- Label: Provide an appropriate name for the button.
- Name: Assign a suitable API name for the button.
- Description: Optionally, add a description for clarity.
- Display Type: Choose List Button.
- Behavior: Select Display in existing window with sidebar or the option that best suits your needs.
- Content Source: Select URL.
- URL: Enter /flow/Create_Opportunity?retURL={!Contact.Id}.
- Note:
- /flow/Create_Opportunity refers to the Flow’s URL.
- retURL={!Contact.Id} ensures that after the Flow completes, the user is returned to the originating Contact record.
- For more details on setting up Flow URLs and return behaviors, check these articles:
- Add the Custom Button to the Opportunity Related List
- Open the Contact object in Object Manager.
- Go to Page Layouts and select the relevant layout where you want the custom button to appear on the Opportunity related list.
- Customize the Opportunity Related List
- Scroll down to the Related List section, or select Related List from the options.
- Locate the Opportunity related list and click the wrench icon to edit its properties.
- Remove the Standard ‘New’ Button and Add the Custom Button
- In the Buttons section, click the + icon.
- Uncheck the New checkbox under Standard Buttons to remove the default ‘New’ button.
- Under Custom Buttons, move the newly created button from Available Buttons to Selected Buttons.
- Click OK and save the changes.
- Test the New Button
- Navigate to a Contact record.
- In the Opportunity related list, you should now see the new button.
- Click the button to ensure the Flow opens and functions as expected.