Loading

Salesforce Platform Flow: Customize New Opportunity Button with Screen Flow

Publiseringsdato: Mar 31, 2026
Beskrivelse

Screen Flow:

  • An interactive flow in Salesforce that guides users through processes using user interface elements.
  • Allows users to input data, make selections, and complete tasks step-by-step.
  • Learn more: Getting Started with Screen Flows.

Action Override:

  • Replaces standard Salesforce buttons (like "New" or "Edit") with custom logic or Visualforce pages.
  • Enables customization of user interactions and workflows.

An organization is looking for a way to replace the standard 'New' button on the Opportunity related list on Contact record with a flow that the admin has created. They want to use this flow to create an Opportunity record instead of the standard 'New' button as they want some customization to their new opportunity screen.

Løsning

In this article, we will see how to achieve this requirement.

Note: In this use-case, the Flow to create opportunity record is already created by the admin. We are just going to look at the steps to add this Flow to the Opportunity related list to be called via a button and replace it with the existing standard 'New' button.

Button Override Configuration

Step 1: Login to your Salesforce account. Click the Gear icon on the top right corner of your screen and select Setup

           

Step 2: From the Object Manager tab, search and select the Opportunity object

           

Step 3: From the Buttons, Links, and Actions section, select the ‘New Button or Link' button

         

Substitute the values as follows:

Label:  Name                                                                     (Note: Provide any suitable Label for the button)
Name:  Name                                                                    (Note: Provide any suitable API name for the button)

Description:  Provide a suitable description.              (Note: It's optional but it's a best practice to provide description)
Display Type:  List Button

Behavior:  Display in existing window with sidebar  (Note: You can choose the best suitable option based on what kind of behavior you need)

Content Source:  URL

URL:  /flow/Create_Opportunity?retURL={!Contact.Id}

Note/flow/Create_Opportunity is the URL of the Flow.

Checkout this article to learn more about how to get the Flow URL and set variable values:
https://help.salesforce.com/s/articleView?id=sf.flow_distribute_internal_url_variable.htm&type=5

retURL={!Contact.Id} is used to provide a return URL so that once the Flow finishes, it will navigate the user to the Contact record from where the Flow was invoked.
Checkout this help article to learn more how to control finish behavior: https://help.salesforce.com/s/articleView?id=sf.flow_distribute_internal_url_retURL.htm&type=5

         

Step 4: Once the button is created, we have to add this button to the Opportunity related list on the Contact object. For that, we have to open the Contact object from the object manager

             

Now, select the Page Layouts section and open the page layout where you need to add that button on the Opportunity related list

            

Step 5: Scroll down to the related list section or select the Related List option (as highlighted below) and find the Opportunity related list. Click on the wrench icon next to the related list to open the properties pane

           

Step 6: Now, click on the '+' icon on the far-right side of the Buttons section

            

  • First, uncheck the New checkbox available under the Standard Buttons heading. Unchecking this New checkbox removes the standard New button from the Opportunity related list
  • As we now have to swap this with the new button to invoke the Flow, under the Custom Buttons heading, move the New button from Available Buttons column to the Selected Buttons column. Select Ok to close the modal window and Save the page layout by using the Save or Quick Save button

         

Step 7:

Testing

Finally, go to a Contact record to test the Flow. Next to the Opportunity related list, you will see a New button which we just added

  • Click on the button and the Flow screen will open in a new window or existing window based on the behavior selected while configuring the Flow button

         

         

-------------------------------------------------------------------------------------------------------------------------------------

Written by: Ajaypreet Singh Saini | Forum Ambassador
Ajaypreet Singh Saini is working as a Salesforce Implementation Specialist at Grantbook. Prior to Grantbook, Ajaypreet served as a Salesforce Administrator for 2 years working on Sales Cloud where he was responsible for configuring and administrating complex processes and maintaining security of Salesforce Instance.

Submissions reflect only the opinions of the user who made available the Submission and not the opinions of Salesforce, regardless of whether the user is affiliated with Salesforce, and may contain or constitute products, services, information, data, content and other materials made available by or on behalf of third parties ("Third Party Materials).  Salesforce neither controls nor endorses, nor is Salesforce responsible for, any Third  Party Materials, including their accuracy, validity, timeliness, completeness, reliability, integrity, quality, legality,  usefulness or safety, or any applicable intellectual property rights. Any Submissions made available through any message board or forum in response to posted questions, or that otherwise purports to answer any questions, including any questions about Salesforce or Programs, are made available for your general knowledge only and should never be relied upon as answers to your specific questions (even if an answer is marked as a “best” answer or with any similar qualifications). You should always contact Salesforce support for answers to your specific questions. Salesforce has no control over Submissions, and is not responsible for any use or misuse (including any distribution) by any third party of Submissions.

If you have questions, tap into the wisdom of our entire Trailblazer Community here: https://trailhead.salesforce.com/trailblazer-community/feed

 

Knowledge-artikkelnummer

002519999

 
Laster
Salesforce Help | Article