Validation for the Item No....

Prem
Member Posts: 34
Dear Friend's
I am trying to validate certain fields in the Item Card... my problem is the item should not be added if those fields are blank..
Regard's
I am trying to validate certain fields in the Item Card... my problem is the item should not be added if those fields are blank..
Regard's
0
Comments
-
Hello Prem,
The easiest way do this would be to add some validation code to the OnInsert trigger of the Item table.
For Example :
// Field Validation
IF (Rec.Description = '') THEN
ERROR('Please provide a Item Description before inserting a new item.');
Please note that this might cause some user irritation -> the reason being let's say you validate 5 fields. If they filled in all the information and only forgot about 1 of the fields then when inserting it will pop up with the error and the user will have to redo all the input again...
Another way to do this might be to put the code on the form that would prevent the user from leaving the form until all the fields are filled in.
Hope it helps
Best Regards
Rabe0 -
Dear Rabe..
Adding code in the oninsert or onmodify trigger will not solve this problem... my problem is if any one of the validation fileds is blank , that record should not get into the system.
Regard's
Prem0 -
Have a look at this thread: How to make a field mandatory...newbie questionNo support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Dear Luc
I had tried all this... as i told u if i just create a record and then navigate to the prvios or next record.. the blank record is created... this is what i want to avoid. and also there is problems when u use the delayedinput when u have table relations
Regard's
Prem0 -
:idea: Therefore I've a little suggestion:
If you have mandatory fields, it would be desirable to show it to the user, so he knows this before he gets the error.
I have two ideas to do this:
1. Highlight the mandatory fields with a background color (e. g. yellow)
2. Format the label of the mandatory fields bold.
The customer will be thankful for this.Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Dear Timo..
Its only a visual check... i have already done it....(even tough not a smart way ) but we are talking about a system validation..
Regard's0 -
I know it's a coding solution but have you tried
testfield(rec.fieldname);
Greetings,Now, let's see what we can see.
...
Everybody on-line.
...
Looking good!0 -
Dear Gomad
Those are the basics which i have done...
Regard's0 -
I can suggest you another way:
1. Block Items after insert (field Blocked must be TRUE, and it couldn't be editable :!: )
2. Provide some function to test the item
if required fields are not blank, then you "Unblock" item, in the other case
you can demand to fill up your field0
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