Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last Updated User
Message
De
20/02/2005 05:56:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00988451
Message ID:
00988666
Vues:
35
>>Nadya,
>>
>>I think you can do so in the RecordValidation rule of the base tables
>>
>>You can use getfldstate(-1)
>>
>>For inserts, just replace tLast_Updated_Date and cLast_Updated_User
>>
>>For updates, loop using getfldstate(-1) and if getfldstate(-1) indicates a change for a field, compare the fieldvalue to the oldval() in case a field is changed and reset to its old value
>>
>>The only drawback is that the RecordValidation rule does not fire for a delete as far as I can see. Don't know whether that is a problem for you
>>
>
>Hi Gregory,
>
>Sounds like a good approach and it would not affect the existing records. The only problem that we have lots of tables and we're using Stonefield. I know how to write a program to update all tables automatically, but I'm not sure how to incorporate it with Stonefield. I'm going to discuss this idea in details with my colleague. Right now he decided to update framework to put some code to update these fields in Save method. However, it would not work for my case if I'm updating multiple tables at once. I found that field_a and field_b works, but I don't want to rely on this naming convention.
>
>Thanks again.

hi Nadya,

I would not add any code to the Save method at all. If you add it to the RecordValidation rule, then you have to put it in only one place

If you do not want to modify the existing RecordValidaton rules you can add your own with an AND, ie (TableValidationOfStoneField() and UpdateLastuserAndDate())

Success,
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform