I don't know of a way to do it without scripts. I tie it into a Custom Menu.
Yeah, I've done the same thing in the past. Wouldn't somebody accessing my file from an external file still be able to delete a record in the parent table? Would there be a way to prevent that?
Actually I've just remembered that this matter came up a couple of years ago and I have already been given a solution to this problem.
It is done in the Manage Security dialog so it works even if the database is accessed from an external file. The catch is that the restriction cannot apply to any full-access account.
In the Data Access and Design section of the Edit Privilege Set dialog, set Records to "Custom Privileges" and a Custom Record Privileges dialog opens. This dialog contains a list of each table in the database. Select the table to which you want to restrict delete and in the "Delete" drop-down select "Limited" and a Specify Calculation dialog opens. The calculation must have a Boolean result. Here is an example that I've tested and it works:
IsEmpty ( ChildTable::_kf__ParentID__t ) ; // there are no child records
Wouldn't somebody accessing my file from an external file still be able to delete a record in the parent table? Would there be a way to prevent that?
You are right. Custom menu's and scripted behaviours only work within the file. If the data is accessible from a different source then you need to address that.
User Accounts and Privilege Sets will give you the control you need. Privilege sets protect your data, regardless of how the file is being accessed.
In the "parent" table set a calculation in the Delete privilege which evaluates to false when there are related data sets present. Similarly, disallow deletion in the "child" tables.