VALIDATE in OnAssistEdit
ervaro
Member Posts: 17
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.
Can somebody please help me to fix this problem.
Thanks.
Erik
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");
Can somebody please help me to fix this problem.
Thanks.
Erik
0
Comments
-
ervaro wrote: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.0 -
Thanks for your reply.
The MESSAGE between these lines is executed but still no validation.
Any suggestions?0 -
Try this:
Action Date - OnAssistEdit() datActionDate := "Action Date"; calendar.AssistEdit(datActionDate,FIELDCAPTION("Action Date"),''); VALIDATE("Action Date",datActionDate);Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
calendar.AssistEdit("Action Date",FIELDCAPTION("Action Date"),'');
What code is there in this function, because I don't think the "Action Date" value is updated when you validate...0 -
from your first post - Does the validate work on Validate-Action Date?
So you want to add some code on the assist edit to stop a blank? What is actually your problem?0 -
I assume that the OnValidate trigger you mentioned is on form and not on table. VALIDATE() calls only table validation, not form field validation...0
-
You are right, I used it as form validation. Will try it as table validation.
Update: Moving the validation to the table works fine. Thanks to all.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
