+ Start a Discussion
Project2Project2 

How do i create a workflow filed update rule when a record is deleted?

Hi,

 

How do i create a workflow filed update rule when a record is deleted?

e.g. Case header has several line items, when a line item is added i am updating fields in another object. I cannot figure out when a case line item is deleted-How do i update the fields.

 

Appreciate your help.

Best Answer chosen by Admin (Salesforce Developers) 
flewellsflewells

By case line item, do you mean you created a new custom object and Case is the parent (master-detail relationship) to that new object?  If yes, this is what I would try (disclaimer - have not tested it out), if the field you are trying to update is on Case.

 

Create roll-up summary field on Case that counts the number of line items

Create a workflow rule on case that triggers when the new value for the RSF is less than the prior value

Add your workflow field update to update field on Case

 

If case line item is not a custom object, or Case is not the parent in a master-detail relationship, or the field you want to update is not on case...I think you'll need to look at Apex Triggers for a solution.

All Answers

flewellsflewells

By case line item, do you mean you created a new custom object and Case is the parent (master-detail relationship) to that new object?  If yes, this is what I would try (disclaimer - have not tested it out), if the field you are trying to update is on Case.

 

Create roll-up summary field on Case that counts the number of line items

Create a workflow rule on case that triggers when the new value for the RSF is less than the prior value

Add your workflow field update to update field on Case

 

If case line item is not a custom object, or Case is not the parent in a master-detail relationship, or the field you want to update is not on case...I think you'll need to look at Apex Triggers for a solution.

This was selected as the best answer
Project2Project2

Thanks.

 

Yes Case/caslinelitem have master-detail relationship. But the field to upadte is in another custom object and references ths case (ID Number).