Wickerman Posted January 28, 2013 Posted January 28, 2013 I had thought that when you attempt to delete a Record that has child records set to also delete upon a Parent deletion, Filemaker responded with a prompt that said something like "Do you want to delete this record and all child records?" Did I imagine that? I guess it might be that when I made layouts with the Status area hidden and only allowed record deletion via a scripted button, *I* had included that warning in the script. But now that I generally leave the status area open and in cases where I want to allow users to delete using the keystroke or standard Delete Record button, is there any way I can include a warning such as this? All it says now is "Permanently Delete this Entire Record?" -- without mentioning child records. thanks for any suggestions.
Rick Whitelaw Posted January 29, 2013 Posted January 29, 2013 Usually allowing the deletion of child records when deleting a parent record is a common sense thing for example, if you delete a contact and his/her address happens to be in a related table, it makes sense to delete the related address. If your situation is not as straightforward perhaps you should not allow deletion of related records and find another way of getting rid of the related (and orphaned) records.
Wickerman Posted January 29, 2013 Author Posted January 29, 2013 Hmm -- I see what you mean. This is a case where I have one table, Collections and a child table Items. All items should belong to a collection. Logically, if a collection is to be deleted, the items (which constituted the collection) should be deleted as well. I'm just a little worried that some users might not be "clear on the concept" and could want to, say, make a new Collection record and expect those Item records to still be there. I could disallow child deletion and then craft some scripted responses to alert them that the Orpahns need to be re-assigned to a new COllection record or be deleted, but it's more fuss than I was hoping for. In this case, I'd just like to make a gentle rmeinder to make the user think about what's going to happen. So I'm thinking the thing to do is probably to disallow the Delete Record function on that layout and script a button on the layout to do it.. . . yeah?
Rick Whitelaw Posted January 29, 2013 Posted January 29, 2013 Yes, or you could send a warning via custom dialog and give the user the choice to delete the child records or not. This further complicates your UI however. Better you should pop up a warning that all child records will be deleted if the current record is deleted and offer the choice to not delete the parent record. Is there any reason to delete the parent record? Probably not, so disallow deletion of the parent record via custom menus.
LaRetta Posted January 31, 2013 Posted January 31, 2013 Hi, You can offer more control by using Custom Menu. Then you can leave Status Bar open and the Delete Record icon can be pointed to run your script which nicely asks whether to delete child records. :^)
Rick Whitelaw Posted January 31, 2013 Posted January 31, 2013 I had no idea scripts could be attached to Status Bar icons!
Recommended Posts
This topic is 4313 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now