October 16, 200322 yr This is probably simple but I'm struggling to figure it out.... How do you create a deletion rule which prevents a user deleting a parent record if it has any children thus avoiding the possibility of orphaned records? I guess it involves the "when deleting a record in this file, also delete related records" checkbox in the edit relationship popup however as far as I can see checking it will result in parent and child both being deleted and leaving it blank will result in orphans. I'm looking to implement a solution that forces the user to delete any existing child records prior to being able to delete the parent. Any advice much appreciated. Iain
October 16, 200322 yr You set all passwords except for the master to Edit Only in File->Access Privileges->Passwords. Then you script all deletions, testing If [relationship::constant] Show Message ["You must first delete child records yadda yadda..."] Else Delete Record/Request [No dialog] End If where constant is a calculated field always equal to 1. If you don't have a constant, use If [Length( relationship::serial )].
Create an account or sign in to comment