XF 1.5 Using _deleteData() to delete records from multiple tables/datawriters?

Dannymh

Active member
Hi,

I am writing a quick system for some internal usage whilst we migrate to XF2. As part of this I need the ability at the top level to delete a record, and then have all of the subsequent records deleted. The structure looks something like this

  1. - Department
    1. Staff in Department
      1. Equipment assigned to staff
So at the top level if I delete a Department I want this to trickle down and remove all the staff that are assigned to that department and all of the equipment assigned to that staff.

I was hoping of doing this with the X or the Delete button on a list page in Admin and tying it to the _deleteData(). At the moment doing so deletes the Department and I just need it to pass on and delete from the other areas. Should I just do this with PostDelete in the datawriter, or does the deleteData function allow me to add additional DW's to delete from?

Thanks in advance
Dan
 
You'd need to use the post delete system for this (to delete the direct children, which in turn, delete their children, etc).
 
Back
Top Bottom