0

I've built a screen flow to create new opportunities and after saving i would like to be redirected to the Opportunity that i just created and the Add Products pop-up should also open. I was able to do this using a URL but it only seems to work for classic mode. I don't see the URL changing when i click on "Add Products" on lightning. Is there a way to call this? Thank you.

1
  • I assume you read this help doc. You should use edit and show the Flow URL for the screen flow
    – cropredy
    Nov 29, 2022 at 19:50

2 Answers 2

0

I am not completely sure how you are launching the Screen Flow, but, assuming you are using an action Button in a record, after the Salesforce release Winter '23, you can embed Flows in a Lightning Web Component.

Here's the documentation: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_flow_embed_component

The way to go here would be:

  1. Create the LWC that contains the Screen Flow.
  2. Choose what happens after the Screen Flow finishes (redirect to the new created opportunity, for example) (in the documentation there are examples).
  3. Create a button that launches the LWC that contains the Screen Flow.

I have done this before using Aura components (https://developer.salesforce.com/docs/atlas.en-us.214.0.lightning.meta/lightning/components_using_flow_cmp.htm). Have not tried the LWC approach, yet, but taking a quick look at the docs, it is pretty similar.

Hoping this is helpful.

4
  • But the problem is to open the Add Products pop-up, not landing in the opportunity record that was created.
    – Nuno
    Nov 29, 2022 at 19:46
  • Am i able to call this Add Products pop-up from an LWC?
    – Nuno
    Nov 29, 2022 at 19:47
  • What type of component is the Add Products pop-up? is it another screenflow? Nov 29, 2022 at 21:04
  • It's the standard page to add products to an opportunity. When we go to the opportunity related list and select Add Products on the Products related list.
    – Nuno
    Nov 30, 2022 at 9:02
0

I also wanted to achieve this before, but as my learning should be not able to do that, check this document: https://resources.docs.salesforce.com/244/latest/en-us/sfdc/pdf/lightning.pdf at page 173-174, for Record Relationship Page Type (OpportunityLineItem in this case), the URL format is:

/r/{objectApiName}/{recordId}/related/{relationshipApiName}/{actionName}

ie.: https://yourdomain.lightning.force.com/lightning/r/Opportunity/{recordId}/related/OpportunityLineItems/view

And the "Add Products" standard page API name is MultiAdd, it seems replacing the View action to others would be able to invoke, but unfortunately the document has mentioned: "Only view is supported for actionName to invoke (p.174)".

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    May 31, 2023 at 21:12

You must log in to answer this question.

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