Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RI Messages
Message
De
13/08/2003 18:10:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
13/08/2003 16:05:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00819926
Message ID:
00819960
Vues:
10
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform