Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Triggers and errors messages - Any suggestion?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Triggers and errors messages - Any suggestion?
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
00976256
Message ID:
00976256
Vues:
42
I have one database, that has one table: Customers.
This table has some fields. Example:

Code (AutoInc)
Name (Caracter)
Phone (Caracter)

I'm not using field or record validation. To do this, I just create triggers.

Here is an example:
Function Customers_Insert
_ErrorMsg = Iif(Empty(Code),"Invalid Code"+Chr(13),"")+;
            Iif(Empty(Name),"Invalid Name"+Chr(13),"")
Return Empty(_ErrorMsg)
The variable _ErrorMsg is public... So, if the trigger failled, I just read its content and show it to the user. If both validations (code and name) has failled, I can show it to the user at the same time.

If I use fields validations, I will get just one message for each time I try to save my record in the table. I don't think it is produtive, so it is not good for me...

The question is: Any suggestion about technics to do it?

TIA!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Répondre
Fil
Voir

Click here to load this message in the networking platform