Field Validation
shibily
Posts: 89
Hi all.
I want to validate some fields (whether it is blank or not) . If it is blank i want a alert message indicating the same. I have more than one fields to validate . It should happen when i am trying to close the screen becuase it is a bounded form.
After getting the message the screen should be intact and focus to the relevant field.
I tried it with ERROR function. The message comes and when i click OK the screen closes. That should not happen
How it can be possible
Thanks in advance
Shibily
I want to validate some fields (whether it is blank or not) . If it is blank i want a alert message indicating the same. I have more than one fields to validate . It should happen when i am trying to close the screen becuase it is a bounded form.
After getting the message the screen should be intact and focus to the relevant field.
I tried it with ERROR function. The message comes and when i click OK the screen closes. That should not happen
How it can be possible
Thanks in advance
Shibily
0
Answers
-
Hi
Have you looked ar the testfield function ?0 -
Hi
The Onclose trigger is too late - try in the Onquerycloseform - this is meant for tests to see if the form can be closed.
0 -
Try this:
Change the DelayedInsert property of the form to yes. Create validation functions in the OnInsert trigger.Rgds,
Jon.0 -
Thanks. It is working fine. Any idea how to set the focus to the specified field after clicking OK in message Box.??0
-
If you want to run some code that sets the focus to a specific control you can't use error of testfield because it stops all processing.
What you have to do is create on the OnQueryCloseForm trigger some code that first validates a field and secondly sets the focus to a field that isn't validated. For example:IF <Rec.Field> = '' THEN BEGIN MESSAGE("%1 is empty",<Rec.Field>); //Doesn't stop the processing CurrForm.<Control>.ACTIVATE; //Sets the focues on the control EXIT(FALSE); //Keeps from exiting the form END;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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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