Hi Guys,
Long time reader - first time poster so go easy please......!
NAV2009 classic client user here (native db).
I'm using the Excel Buffer table to read many values from a spreadsheet into the buffer and write them to a table. It all works fine except I've noticed that I can import values into an option field that should not be allowed.
Specifically I have a field (lets call it field "x") which should only allow the values 1 or 2 in it, yet I've noticed that I can import any number between 1 and 9 into this field. If the number is more than 1 character it does not work. I'm wondering if it's behaving like this because the value is an integer since I have a similar field which imports decibels (the available options are 30db, 35db etc.) yet when I try to import 32db, I get the error '32db' is not an option - which is great, however I would have expected to see a similar error when I tried to import the number 9 in field x.
I should point out that since I'm using the Excel Buffer table, the value it reads from the spreadsheet is read as text, and in the case of field x, I'm using evaluate to convert it back to an integer and insert into the table - perhaps this has something to do with it?
Has anyone else come across anything like this before? Is there a simple way to stop the import when incorrect values are encountered?
Thanks in advance!
0
Answers
When you use an option field as parameter in a function then you don't need to set any option value. That means in that case it doesn't check for if the given option value exists, it just takes the integer value.
Is it possible that the OptionString of your option field contains some comma (e.g. Value A, Value B,,,,,,,,,Another Value)?
Thanks for your response...
I did think that myself - originally the OptionString was ",1,2" but I changed it to "1,2" for the purpose of testing this problem.
I also added 1;2 to the ValuesAllowed field in the properties for the field.
Neither of the changes fix the problem.
RIS Plus, LLC
EVALUATE(Temp, ExcelBuf."Cell Value as Text");
HiQDoorBuf.VALIDATE(HiQDoorBuf."Undercut (mm)",Temp);
RIS Plus, LLC