Skip to main content
I have a process that updates a quoted line item based on the total price of the quote. It works only if you add the item after all of the other products are on the quote. So you basically add in your regular products, add in the quantities and discounts, then save the products. Only then, after you add this line item it will update the price.

 

What I'm looking to do is be able to add the product with all of the other products, and update the price when the total price changes. Almost like a trigger.

 

Here is my process:

 

Process builder - update field everytime another field changesUser-added imageUser-added image

 

Is there a way for this to update without adding in the line item after the other products have been added? Or is this something a trigger would be better suited for? I'm guessing since the Total Price of the quote isn't generated until the products are added, it doesn't have a value until the quote items have been added.
1 resposta
  1. 12 de mar. de 2021, 05:51
    Hi Josh, 

     

    No, you cannot do this with process builder. If you create another process on quote that would update the surcharge whenever the price changes, then the surcharge itself will be calculated incorrectly as the price will include the previous value of the surcharge. 

     

    What you need is a mechanism that counts the total amount of non-surcharge items, and calculates the surcharge based on that.

     

    You might be able to do this with a record-triggered flow on the line item. Every time a line item is created, or its price changes, you'll want to query all items in that quote that aren't the surcharge. Add them all up into a variable. 

     

    Next, query for the surcharge row. If found, update it with the new surcharge calculation. Otherwise, create a new surcharge row. 
0/9000