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
Bithyzis DimitriosBithyzis Dimitrios 

Flow advise needed

Continuing from a previous post to which I have found my flow design error, I decided to take the flow one step further.

Once I locate the two PriceBookEntries for my Product, standard and custom via the loop element I wish to split those findings into two (for the current example) sets of "records" and only keep the "records" relative to the custom PriceBookEntry.

So I introduced a Descision Element after the loop and opted for the following criteria (photo 1 attached)

{!SObjvariableIndividualPriceBookEntries.UseStandardPrice} = {!$GlobalConstant.False} ---- for checkbox not checked


From the debug log, I receive the following: 

1. Fast lookup identifies the records
2. Loop, loops through the variables: 01u0E00000D6a8TQAR,01u0E00000D6ayhQAB and holds the 01u0E00000D6a8TQAR (standard PriceBook)
3. Decision element: Executes outcome Yes
4. Assignment element: Assigns a null value

If I change the criteria on the assignment from False to True
From the debug log, I receive the following: Error Occurred: Too many SOQL queries: 101
From observing the debug log, I can see that the

1. Fast lookup identifies the records
2. Loop, loops through the variables: 01u0E00000D6a8TQAR,01u0E00000D6ayhQAB and holds the 01u0E00000D6a8TQAR (standard)
3. The decision element: Skipped this outcome because its conditions weren't met
4. Fast lookup identifies the records
5. Loop, loops through the variables: 01u0E00000D6a8TQAR,01u0E00000D6ayhQAB and holds the 01u0E00000D6ayhQAB (custom, the one I am looking for)
6. The decision element: Skipped this outcome because its conditions weren't met
7. Fast lookup identifies the records
8. Loop element finds no records to loop through
9. Fast lookup identifies the records
10. Loop, loops through the variables: 01u0E00000D6a8TQAR,01u0E00000D6ayhQAB and holds the 01u0E00000D6a8TQAR and I am landed on step 2 again.

Any guidance will be greatly appreciated
User-added image

With regards
Dimitrios
Best Answer chosen by Bithyzis Dimitrios
Bithyzis DimitriosBithyzis Dimitrios
Solved. Just needed to "rearrange" the elements
Photo attached
User-added image

With regards
Dimitrios