0

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!

0

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 May 23 '16 at 6:00
  • @Pooja yes, in my opinion you should go for an after trigger. – Saumya Ranjan Satapathy May 24 '16 at 4:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.