Delete orphan records

He we have added a custom module that has a one to many relationship with cases so:

Cases
> one to many > Repairs

The issue we have is, if a case is deleted, the repairs remain, and this affects the reports. I have looked at using a workflow to clean these up, but there is no delete option on work flows.

Is there away when a case is deleted, it can delete it’s related repairs, or a way once a week, a scheduled job cleans this up?

any help would be great.

Cheers
Pete

Version 7.10.7
Sugar Version 6.5.25 (Build 344)

In the Workflow, you can delete records: just use “Modify Record” action, select field “Deleted”, then “Value”, then true (checked).

You can also do this from the database using SQL (which can then be put inside a custom Scheduler Job).

1 Like

Thanks you.