Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to prevent field validation from running?
Message
De
24/10/2003 03:28:09
 
 
À
23/10/2003 13:25:20
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00841695
Message ID:
00841965
Vues:
28
>I'm using a VFP8SP1 database. It contains a table in which I've put a three field validations that calls the same stored procedure (ie. the same stored procedure is called from three fields). Is it possible to prevent that validation from firing when I update any of the three field values?
>
>Why would I want to do that?
>
>Well, I put the validation in to ensure business rules are enforced when users open and browse the table in VFP. At runtime, though, I have a form that allows "batch processing" which updates the fields using a replace command. The stored procedure takes a second or two to run which is acceptable when browsing, however, if called via a replace all command, those seconds quickly add up and then it becomes "too long" to wait.
>
>So I was hoping that there could be a SET FIELDVALIDATION OFF before I do a replace all command then I could SET FIELDVALIDATION ON after. I couldn't find one :(
>
>Does anyone have any suggestions, ideas or comments?
>
>TIA
>
>Mike

Mike,

Your field validation rule(s) could check for the presence of a variable

eg
private SomeLongVariableNameForTable_FieldRule

SomeLongVariableNameForTable_FieldRule = TRUE

replace Field1 with aValue in Table all

&& field validation rule

do case
case (type('SomeLongVariableNameForTable_FieldRule') = T_LOGICAL) and SomeLongVariableNameForTable_FieldRule
    && do Nothing

otherwise
   && do Checks

endcase
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform