You need to sign in to do that
Don't have an account?
Updating Total Price on OpportunityLine Item after approving a custom field on Opportunity
Hi Guys,
I'm a newbie on Apex code development. Am trying to solve this for days now, I also tried exploring workflow rules and field updates, but I had no success. I hope you can help me with this.
Below is the senario:
There are two important custom fields under Opportunity -- Submitted Discount Approval Request & Discount Approved, both of them are checkbox and are uncheked/false by default.
Submitted Discount Approval Request field should be checked before an Opportunity can be submitted for Approval on the Approval History block under the opportunity page. After submission, a new entry on the Approval History block will ask to approve or reject the request. If the manager approves it, the Discount Approved field will become checked/true.
Now here's the thing, on the Opportunity products, below are the fields,
Action Product Quantity Sales Price Discount Amount Total Price Date Line Description
Edit | Del | GenWatt Diesel 1000kW | 2.00 | $100,000.00 | $20,000.00 | $200,000.00 |
|
If the Opportunity Discount Approved field becomes checked/true, the Total Price field of Opportunity Products(s) should automatically be updated based on (Total Price - Discount Amount). What happens now is, I need to edit and save the Opportunity product before the changes could take effect.
To make the story short, the Total Price should automatically become $180,000.00 after the Discount Approved field of the Opportunity has been checked/true -- this happens when the Submit for Approval is Accepted by the Approver.
Thanks in advance.