Check field entry

frederic.w
Member Posts: 11
Hello,
I would like to check that for example the fields "Item Category Code" and "Location Code" are not empty when going to the next record or living the item form.
With this kind of check I would like to tell the user he has forgotten to enter important information's. Of course if he enters anything the check did not help, but at least he was informed.
Is there a easy way to do that kind of check?
Thanks for your help,
Frederic
I would like to check that for example the fields "Item Category Code" and "Location Code" are not empty when going to the next record or living the item form.
With this kind of check I would like to tell the user he has forgotten to enter important information's. Of course if he enters anything the check did not help, but at least he was informed.
Is there a easy way to do that kind of check?
Thanks for your help,
Frederic
0
Comments
-
Form - OnQueryCloseForm() : Boolean
EXIT(CheckMandatoryFields);
Form - OnNextRecord(Steps : Integer) : Integer
IF NOT CheckMandatoryFields THEN
EXIT(0);
CheckMandatoryFields() : Boolean
EXIT(("Item Category Code" <> '') AND ("Location Code" <> ''));Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
It depends how experienced you are.
I am here using the solution where the default value for "Blocked" is always Yes and while validating the Blocked field (if new value is Blocked=No), system checks against the fields what have to be filled (simple TESTFIELD commands).0 -
Well, I'm very new with Navision and don't have much experience!
Where do I have do declare the "CheckMandatoryFields(): Boolean"?
Is it possible to tell the user witch fields needs do bee field up?0 -
frederic.w wrote:[...]
Where do I have do declare the "CheckMandatoryFields(): Boolean"?
[...]frederic.w wrote:[...]
Is it possible to tell the user witch fields needs do bee field up?
EXIT(("Item Category Code" <> '') AND ("Location Code" <> ''));
with the fields to be checked:
EXIT(("Item Category Code" <> '') AND ("Location Code" <> '') AND (MyCodeField <> '') AND (MyBoolean <> FALSE) AND (MyDecimal <> 0));Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Hello Timo,
as soon I put the value:
Form - OnNextRecord(Steps : Integer) : Integer
IF NOT CheckMandatoryFields THEN
EXIT(0);
I can't step from one record to an other with the icon "Next" , "Previous" or "PpUp" , "PgDn" even if all fields are filled up.0 -
Please post your CheckMandatoryFields() code here so I can have a look.Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
I tried to use exactly the code from your example:
Form - OnQueryCloseForm() : Boolean
EXIT(CheckMandatoryFields);
Form - OnNextRecord(Steps : Integer) : Integer
IF NOT CheckMandatoryFields THEN
EXIT(0);
CheckMandatoryFields() : Boolean
EXIT(("Item Category Code" <> '') AND ("Location Code" <> ''));0 -
I have no idea at this time.
Could you check it with the debugger?Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
There is small error in the code you supplied.
You leave the exit result uninitialized (and therefore = 0) in OnNextRecord if the added function returnes TRUE.
The correct trigger for OnNextRecord(Steps : Integer) : Integer would be
OnNextRecord(Steps : Integer) : Integer
IF NOT CheckMandatoryFields THEN
EXIT(0)
ELSE
EXIT(Steps);0 -
](*,) #-o :whistle:Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
I'm soory, as soon as I put the value:
OnNextRecord(Steps : Integer) : Integer
IF NOT CheckMandatoryFields THEN
EXIT(0)
ELSE
EXIT(Steps);
I can not step anymore in the form from one record to an other with the icon "Next" , "Previous" or "PpUp" , "PgDn" even if all fields are filled up.
Is there a solution?0 -
The code should be:
IF NOT CheckMandatoryFields THEN EXIT(0) ELSE EXIT(NEXT(Steps));
0 -
](*,) :-#
I forgot the actual intended behavour of the trigger.0 -
The problem with the stepping through the records is ok.
When the checked field is empty , I would like to have a message "Enter Category Code" when stepping to a next record. The program should stay on the actual record and not show an empty new record. How can I program this?
Thank you for your help and patience!0 -
No solution??0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions