You need to sign in to do that
Don't have an account?
Brian Chipman 4
Trigger to update a related object record on delete
I can write a simple trigger to update fields on the same object. However, I have requirements that I'm not having success with even though there are a few pertinent examples. The requirements are:
1) When the Total_Reimbursement__c field is updated on a Service_Order__c custom object record, the SOChanged__c field on the related (Lookup) Asset record is set to true.
2) When a Service_Orders__c record is deleted, the SOChanged__c field on the related (Lookup) Asset record is set to true.
The goal of course is to be able to, especially in the case of 2) above, kick off a variety of flows/processes that we might create when a Service Order is deleted on the update of this field. 1) above of could be done in a workflow, but if I'm doing a trigger, might as well put it there too. Anything to help get me on my way would be appreciated.
1) When the Total_Reimbursement__c field is updated on a Service_Order__c custom object record, the SOChanged__c field on the related (Lookup) Asset record is set to true.
2) When a Service_Orders__c record is deleted, the SOChanged__c field on the related (Lookup) Asset record is set to true.
The goal of course is to be able to, especially in the case of 2) above, kick off a variety of flows/processes that we might create when a Service Order is deleted on the update of this field. 1) above of could be done in a workflow, but if I'm doing a trigger, might as well put it there too. Anything to help get me on my way would be appreciated.
All Answers