function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kristopher TurekKristopher Turek 

Using Flow to add Opportunity Products from lookup

This topic has been discussed a few times but nothing has shown how to use flow to actually add the products.... is there a step by step tutorial on how to add Opportunity Products to an Opp from a lookup field on the Opps page? I know it is redundant but we are adding Intacct to our system and it requires fields to be created on the form to initiate custom invoice schedules.. the user adds product one from a look up and then adds specific dates the invoices go out... then product two if required and so on.. I would like to add the Opp product automatically based on the lookup field from product one - 
NagendraNagendra (Salesforce Developers) 
Hi Kristopher,

Create a flow with the following steps:

1. input screen to allow user to enter some filters that will help narrow down the products. These could be custom fields.

2. record lookup element--this will take what was entered in the first step and look up the values to find matching results of available products. Apply the product ID chosen to a variable for the later step.

3. display screen--show the results from the lookup and allow a user to choose which product they want

4.Record create:create the opportunity line item record--this is the tricky part because you will need to link it back to the OppID you started with.  You can pass the OppID into the flow using the URL on the flow button.  You will also need the variable you set in step 2 (productID)

5. Display screen: show the user what product they have chosen and ask if they'd like to add another one.

6. Decision element--If yes, add another product, return to step 1 of the flow. Otherwise, exit flow.

See here for more info about passing IDs in Flow:

Mark this post as solved if the information helps.

Best Regards,
Kristopher TurekKristopher Turek
I have seen this before... it doesnt explain though how to set it... just says create variable... what variable? I used the step by step listed in the link below, changed it to Opps and hit a wall as the Opportunity object does not have access to the pricebook2id ... how would i go about this another way?

On the Choice Dropdown List, where it says Select resource, Click on Create New, then Dynamic Choice.  Enter the Unique Name as Products, the Value Data Type as Text, and in the Create a choice for each, select Pricebook Entry.
Next, select Field equal to Pricebook2Id, Operator as equals, Value as {!sovQuote.Pricebook2Id}.  Click Add Row to add one more row, for Field select IsActive, Operator should be equals, and Value should be {!$GlobalConstant.True}.
This will select the Pricebook Entries that are part of the Pricebook from the Quote and that are Active.  This brings up a great question, what are Pricebook Entries?  If Pricebooks are a type of grouping of Products and the associated pricing, for instance the prices for Non-Profit companies, Pricebook Entries are a mix of the Product and the Pricebook.  Essentially, if Product A was in 2 Pricebooks, there would be 2 Pricebook Entries, one for each Pricebook and Product A.  In thinking in objects and records, Pricebook 1, Product A, is Pricebook Entry 1A, while Pricebook 2, Product A, is Pricebook Entry 2A.  This is significant because you can have different pricing per Product in different Pricebooks.  Below is an example of 1 Product in 2 different Pricebooks."