For a field I use the OnAssistEdit trigger in C/AL. In this trigger I also put a VALIDATE command but it seems the validation is not executed at all.
Action Date - OnValidate()
IF "Action Date" > TODAY() THEN BEGIN
ERROR('Date is after today');
END;
Action Date - OnAssistEdit()
calendar.AssistEdit("Action Date",FIELDCAPTION("Action Date"),'');
VALIDATE("Action Date","Action Date");
Between those two lines add a MESSAGE('!!!!!') to see if the VALIDATE is called before you choose a date. I Had a similar issue in a different case where RUN was used instead of RUNMODAL. Maybe it's something similar here.
@Kriki: Unfortunately it did not work. @JPHSC: It is a calendar form to pick a date (also downloaded from this site). When I put a message after the calendar form the picked date is shown.
Comments
Between those two lines add a MESSAGE('!!!!!') to see if the VALIDATE is called before you choose a date. I Had a similar issue in a different case where RUN was used instead of RUNMODAL. Maybe it's something similar here.
The MESSAGE between these lines is executed but still no validation.
Any suggestions?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
What code is there in this function, because I don't think the "Action Date" value is updated when you validate...
@JPHSC: It is a calendar form to pick a date (also downloaded from this site). When I put a message after the calendar form the picked date is shown.
So you want to add some code on the assist edit to stop a blank? What is actually your problem?
http://www.BiloBeauty.com
http://www.autismspeaks.org
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Update: Moving the validation to the table works fine. Thanks to all.