Cascading Delete
Cascading Delete
It would be great if AppGini had the ability to cascade delete all children records when a parent record is deleted. Just a thought.
Re: Cascading Delete
Hmmm, should work.
Can you check the following settings:
PS: Another idea is creating a trigger on database level, but, personally, I prefer not creating database triggers for better (=easier) portability/migration/updates.
Can you check the following settings:
- Grant DELETE-permission on the subtables for the user's group who is deleting the master record
- Check the correct setup of the lookups (as those connect a subtable's records to a master record)
- Option
[x] Delete records even if they have children records
- Option
[X] Allow mass delete
on the master table - Just for clarification: Check the PHP function
TABLENAME_delete()
inTABLENAME_dml.php
. All related subtables should have a separate block of code, starting with// child table: SUBTABLENAME
. If your code does not delete related records of certain tables, check if those tables do have a separate code-block there. If not, I guess there is a problem with setup of that specific lookup.
_before_delete()
-hook. After deleting all child-records manually you should also cleanup orphanened membership_userrecords
.PS: Another idea is creating a trigger on database level, but, personally, I prefer not creating database triggers for better (=easier) portability/migration/updates.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityRe: Cascading Delete
Hi Jan,
I have done the items you suggest and am able to delete the parent record but then I still have orphaned children records.
I have done the items you suggest and am able to delete the parent record but then I still have orphaned children records.