I need to update a field on Opportunity. Opportunity is related to OpportunityProduct.

I've a workflow on OpportunityProduct where Evaluation Criteria is set as Evaluate the rule when a record is created, and every time it's edited.

This works fine for record insert and record update on OpportunityProduct. It updates a field on Opportunity object when a record is created, and every time it's edited without any issues.

But if user is deleting a record, field on Opportunity is not getting updated.

How to achieve this that on deletion of a record from OpportunityProduct?

For example - Opportunity A is having 2 OpportunityProduct associated with it. OpportunityProduct record 1 is having a value A, and OpportunityProduct record 2 is having a value B. So using a workflow I'm updating Opportunity field as A, B (comma separated value). But if user deletes any OpportunityProduct record say record 2 then Opportunity field should get updated as A instead of A, B How to achieve this?? Kindly help!

1 Answer 1


yow can achieve by writting a trigger on OpportunityProduct before delete.

  • Why before delete? after delete...as after deletion of OpportunityProduct row I need to update Opportunity field with remaining OpportunityProduct values, if any i.e. in above example with A as B is deleted by user
    – Pooja
    Commented May 23, 2016 at 6:00
  • 1
    @Pooja yes, in my opinion you should go for an after trigger. Commented May 24, 2016 at 4:59

You must log in to answer this question.

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