function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jnguyen1Jnguyen1 

Update field on child record when parent record gets deleted

I have a lookup relationship between Object A and Object B . “A” is the parent to “B”.

When a record from “A” gets deleted, the related field value in record “B” is removed. What I want do is remove the field value of a different lookup field value on “B” once the field value between “A” and “B” is deleted.

When a field value is removed on the child, due to the parent record being deleted does this count as an update to the record? If so, I believe it should be possible to update this through visual workflow, process builder or workflow rules, but have not been able to get this to work.

I have also tried using a formula field checkbox. When checkbox = TRUE on record B, run the workflow rule, visual flow, or process builder, but have been unsuccessful.

Is this possible through visual workflows, process builder, or workflow rules?
 
Shawn Reichner 29Shawn Reichner 29
You should be able to do this via Process builder.  The tricky part is targeting the deleted record, but in your case, you can fire the process off of the Child record when it is updated.  So the process that I am thinking will work is like the following... If the Lookup field ISCHANGED and or is now Blank or NULL that would be your entry criteria.  Then your action would be to update the record that started the process, and update the other lookup field to Null or Blank.  Hope that makes sense. 

Shawn
walters954walters954
This should be able to be accomplished with flows and process builder.
Check out this video that shows off how to conditionally update child records using flows.
https://youtu.be/S15XLpjzz3I

If this helped make sure to make it as the best answer.