>If I setup RI for a field so that deletion is restricted, when a user tries to delete a parent record for which multiple child records exists, he gets an error.
>
>"Unable to commit changes- delete trigger failed"
>
>This is exactly what I want to happen, except i would like to display a friendlier message that would make sense to the ordinary user.
>
>How can I display my own message instead?
I created a standard function, CanDelete() or something, that checked the child records according to the RI-information. Unfortunately, I can't locate the function right now.
The basic idea is to get the RI-information with the function ADBOBJECTS(), parameter "RELATION", to get a cursor with relations.
The function should be invoked before the TableUpdate().
The corresponding error message might read something like: "I can't delete that record, because there are related records in table (Tablename)."
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)