0

Hi Im going to try to illustrate what I want to achieve through this flow:

Using Quotes I have a Currency Field named AgencyFee__c on Quote And I have a Cross Object Currency Formula named BankFee__c on Quote Line Item Which References BankFee__c (Another Custom Currency Field) On Price Book Entry

So I need to add all the quote line items BankFee__c values and save that sum result in their father Quote AgencyFee__c field

In debug mode it works as expected:

Debug

But When I do it Manually in the org, it just doesnt sum any value, and AgencyFee__c remains as 0.

Quote Details

Here is my flow structure:

Flow

Getting Quote Line Items

Get Records Element

Adding each one of their BankFee__c values into one variable

Assignment Element

Updating AgencyFee__c in Quote with the result of that sum

Update Records Element

As you can see, the string "Help Me" is being updated, but something is wrong with the loop or the currency fields. But I cant figure out what the problem is.

3
  • I'm going to guess that in debug you chose a quote w items, but in non debug use case, the flow is triggered before it has any line items. Check your flow entry conditions
    – cropredy
    Sep 25, 2022 at 3:53
  • Hi, It is a record triggered flow and is set up to run when a record is created. I dont know how to specify this flow to run specifically After or Before Create. If you do please let me know
    – Samuel L
    Sep 25, 2022 at 4:13
  • Its After Insert, since I chose "Actions and Related Records" Button @cropredy
    – Samuel L
    Sep 25, 2022 at 4:22

1 Answer 1

0

The reason you are observing this is most likely because during Debug, you used a Quote w/ Line Items as the test record.

But at runtime (live), if the Flow is triggered when a record is created, then it will be triggered when the Quote is created which occurs before any line items have been created.

You'll need to change the flow triggering criteria to either:

  • When the number of line items equals some Quote.Expected__Number_Line_Items__c
  • When the quote's status changes to some value indicative of all line items being entered
  • Change the flow entry criteria to be on creation of each Quote Item (assuming the business requirements can be met.

Bottom line, you need to either do the logic when you know all the line items exists or do the logic on a triggering event on each line item.

You must log in to answer this question.

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