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.
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.
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
: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.
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 field
Comments
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
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
Prem
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
Prem
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.
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
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's
Greetings,
...
Everybody on-line.
...
Looking good!
Those are the basics which i have done...
Regard's
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 field