question about validate function

tompynationtompynation Member Posts: 398
If i read in the help about the validate function it says that this fires the OnValidate trigger of your field

Now i have this code for a button click:

<Control1000000038> - OnPush()
VALIDATE(AantalKgTotaal,StandaardProductie);
MODIFY;

And then this piece of code in the OnValidate trigger of the field

AantalKgTotaal - OnValidate()
lv_PORegel.RESET;
lv_PORegel.SETRANGE(lv_PORegel.FabricatieID,ID);
lv_PORegel.SETRANGE(lv_PORegel.Fabricatienr,Fabricatienr);
IF lv_PORegel.FINDFIRST THEN BEGIN
REPEAT
lv_PORegel.HoeveelheidKG := (lv_PORegel.HoeveelheidKG / gv_OudTotaal) * AantalKgTotaal;
lv_PORegel.MODIFY;
UNTIL lv_PORegel.NEXT = 0;
END;

CurrForm.POProductFormuleSub.FORM.RefreshForm;

But when i press the button, the new value gets assigned but the OnValidate doesnt get executed :?:

Is there something wrong with the code, or else how can i get the OnValidate trigger execute after i assign a new value with the button click?

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    The field validation of the table will be fired. OnValidate of a certain field on a form will only be executed if you enter a value through that specific field control.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.