I have 3 tables: Note, Issue, and NoteIssue. If the user attempts to delete an Issue, I would like to display a friendly message if there is a foreign key violation in the NoteIssue table. The foreign key error message from the database is pretty ugly. I was wondering how some of you have dealt with this in your apps.
You really have a couple of options, depending on how your objects are used and the methods you use to delete them
Hopefully the two suggestions above make some sense, we need a bit more information about your actual classes not the database structure to be able to provide a more detailed / appropriate response. Normally if the user could delete the issue, you would need to ensure that any foreign keys were removed either in the dataportal_delete method, stored procedure or using cascade delete.
I think option #2 is probably going to be the best fit for my situation. Thanks for your help on this.
Copyright (c) Marimer LLC