Why not make (or go to) a layout based on the child record. The script would go that layout, find the records and delete them. Then exit the script.
Hi. If your parent to child relationship is set up to "Delete related records ..." on the child side (see screenshot)
then you could have the child records displayed in a portal, create a script that loops through the portal rows and deletes them. That's a pretty cumbersome way of doing it.
It would be easier and better to do a GTRR and delete them in the related records layout. This will not delete the parent record. Then return to your original layout. Your parent record should be there.
Thank you both.
I am currently doing the GTRR delete as I need to keep the parent record so the relationship delete won't work for me in this instance. As part of this database is on WebDirect I was wondering if was possible to do the deletes without having to go to the child layout and have WebDirect have to redraw both screens when it goes and comes back again. You right about the Portal method too Chris, a bit clunky.
GTRR it is then!
You can make a simple blank layout just for this purpose to speed things up...there is still some "redraw", but it can be minimal...you don't even have to have any fields on that layout for the child table.
Another option... you can have a utility table where you can deposit a single record, and that table would have a cartesian relationship to the child table with cascading deletes turned on (DANGER, USE WITH CAUTION!)
Since the cartesian matches all records, if you delete one record in the utility table, all records in the child would get deleted.
That way this could all happen without leaving the context of the current record. Create utility record in a portal, then delete that portal row...
Hope this helps (maybe)
Thank you. The blank layout is in place.
Mike, that is an interesting idea. However, this is a multi-user database. Wouldn't a Cartesian delete everyone's records?
However, maybe non Cartesian relationship to the utility table and out through to the child records may work though? It would only delete a specific user's records (each user's log-in creates a session-specific record that gets deleted when the user logs out).
What do you think?
Not knowing how much info is on the parent record...you could also duplicate the parent, then delete the duplicate and have it wipe the children that way...
All you really need is a second parent related to the same children...
This should not be construed as spousal abuse....
Just thinking out loud...
Yes, that's a good idea.
And it does generally take two parents to make a child...