I m checking some of fields validation on OnNextRecord() trigger...if fields validations are not satifiy do not want to allow to naviagate the next,previous records...
i put the code on OnNextRecord()
fnValidate;
IF bIsError THEN
BEGIN
MESSAGE('Please enter the Mandatory Fields ' + strError) + ' !!');
EXIT(false); //Not working
END;
AFTER SHOWING THE MESSAGE, THE FORM WILL BE CLOSED, I WANT TO APPEARE THE SAME RECORD UNLESS FILL THE DETAILS/DELETE ...
How can i control this, Exit(false) is not working on NextRecord...
0
Comments
ERROR will produce an error message and stop the remaining code from executing.
My Blog - nav.education
There's got to be hundred mandatory field posts.
http://www.BiloBeauty.com
http://www.autismspeaks.org
2. I hav checked the manditory, when FORM CLOSE & NEXT,PREVIOUS NAVIGATION...
.....Find with Form Close trigger(onquearyclose), but i can't control when i click NEXT(navigate record) button...
In 'OnQuearyClose' --> calling manditory function, if true show error and EXIT(FALSE)
but 'OnNextRecord' ??? i put onAfterGetRecord also..NO EFFECT
IF bIsError THEN
BEGIN
Rec := xRec;
xRec.TRANSFERFIELDS(Rec);
CurrForm.UPDATE(FALSE);
ERROR('Please enter the Mandatory Fields ' + DELSTR(strError,STRLEN(strError),1) + ' !!');
END;
The onvalidate on the blocked field you could put
testfield('myfmandatoryfield1')
testfield('myfmandatoryfield2')
etc.
if one of them is blank then it wouldn't let you unblock the record. Then the only way to use the record is to make sure all the fields are filled.
IF it's not like that have you thought of trying something like this.
If "MyMandatoryField" = '' THEN BEGIN
MESSAGE('This field cannot be blank %1',"MyMandatoryField");
CurrForm."MyMandatoryField".ACTIVATE;
END;
Also Set the property "Not Blank"
http://www.BiloBeauty.com
http://www.autismspeaks.org