Hi,
I have the following problem:
In one of my tables I want an integer field to be non-blank and non-zero. I set the property on the field but it only works if the user visits the field. For example:
1. If the user never enters the field the value is allowed to be blank
2. If the user enters the field and then deletes the contents, then not blank works as expected
What should I do?
thank you in advance
Comments
Maybe what you can do is ristrict the user to continue as long as the user hasn't entered a value in your notblank field.
For instance in the onactivate trigger of all the following controls you can perform a check on your notblank field to see if its empty.......if so send a message and set the focus on your notblank field.
:-k "Chance Favours The Prepared Mind"
So let me rephrase: I would like to have the RDBMS NOT NULL equivalent in Navision. No matter what the form checks or not, Navision will not accept a blank value for a new or modified record.
1. Put a "Not blank" default value in the field .
2. In the OnInsert tigger, check the field and give a message if it's empty
3. ... ?
TESTFIELD("My Fieldname");
//Pelle
dont think such a property exists.
try coding in table triggers such as oninsert and/or onmodify
:-k "Chance Favours The Prepared Mind"[/quote]
Form - OnQueryCloseForm(), Form - OnInsert() and Form - OnModify() add coding:
TESTFIELD("My Fieldname");
This will only suitable for the record show on the form and the "My Fieldname" is empty.
If you want to check all the record inside the linkage table the "My Fieldname" is not empty. Try to add some coding at Form - OnQueryCloseForm and add a global variable(Locl variable also can) = Form's linkage table
TableVar.setrange("My Fieldname", 0); //Form your case "My fieldname is interger
if tablevar.count <> 0 then
if tablevar.find('-') then
Testfield("My Fieldname");
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.