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!

1 Answer 1

0

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

2
  • 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 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.