I have a form as follows. - 2 globals : MyField Code 10 SalesLine Record Sales Line I put MyField on the form, with the following code : OnValidate() MESSAGE(‘This is the OnValidate code…’); OnLookup(VAR Text : Text[1024] : Boolean IF FORM.RUNMODAL(0,SalesLine) = ACTION::LookupOK THEN BEGIN MyField := SalesLine.“Document No.”; EXIT(True); // This should call the OnValidate code !!! END; So, if I enter something in my field, the OnValidate works. But, if I use the Lookup, MyField is filled in with the value from the SalesLine, but the EXIT(True) does not call the OnValidate code, but instead the value in MyField is ‘cleared’.
In OnLookup, you should not directly assign a value to MyField. Instead, you should assign the value to the “Text” parameter. The system will automatically validate the field with the content of the “Text” parameter after OnLookup returns with an exit value of TRUE.
I’ve seen this as well, for some reason the forms onvalidate triggers are skipped. Another ‘feature’ of Nav.