Hello everyone,
I began developing a script in sandbox that would assign a commission percentage to each line item of a sales order and quote.
I created a transaction line field, COMM % and have it set to a list record. The values range from 0 - 10.
I am reading into SAID 94464 for inspiration. However, this script is doing things different. My process is going to be much different than that.
What I want to do is assign the options based on the line item's EST. GROSS PROFIT PERCENT
If the GP is within a certain percentage range, then the COMM % will select whichever option there is.
Examples:
- If a line items gp% is between 10% - 15%, then select option 1
- If a line items gp% is over 50%, then select option 10
The script I am reading through, provides a general gross profit to the entire order.
How can I do this for every line item? I was thinking it can go like this.
At first, I was considering EST. GROSS PROFIT PERCENT, but this field only appears when viewing the record and not during the edit process.
I would need to calculate the GP by acquiring the EST. EXTENDED COST and Amount values, once I get the GP % from that, then I can run it through the conditions of which to assign the COMM % option.
It would work the same way with the aftersubmit function.