Hello,
I am trying to use a custom discount field and autopopulate it using Process Builder.
It should be calculated by taking the sales price (unit price) - total price
Currently, I have the criteria set to:
- [QuoteLineItem].UnitPrice (also Sales Price) is changed = true
When this happens, the discount price should calculate. This is my current formula, but it is blanking out the discount field. Could somebody help me figure out what i'm doing wrong here?
([QuoteLineItem].ListPrice - [QuoteLineItem].TotalPrice ) / ([QuoteLineItem].ListPrice)
@John Smoak Is there a reason you aren't using a formula field for this? Unless you need to trigger something when the discount price field updates, I would suggest using a formula field. It will be a lot simpler and easier to update (instead of having to edit all your quote line items and change the unit price to make the discount price field update).
Also, you should be aware that Flow is now the preferred automation tool (not Process Builder) and performance-wise it is much faster and optimized. Here's an introduction to Flows that might help you: https://www.salesforceben.com/introduction-salesforce-flow/
For your logic specifically, is there data in the ListPrice and TotalPrice fields when you test it? Sometimes the default return value is a blank field if there is an error (like no data or possibly because of dividing by 0).
If you debug in Process Builder, can you see what data is in the underlying fields and if there is any error message?