In the following code I open the ‘Vendor’ table (23) and read the first field ‘No.’ (Data Type ‘Code 20’).
Locals:
lVarValue Variant
lRrfTable RecordRef
lFrfField FieldRef
Code
lRrfTable.OPEN(23);
lRrfTable.FINDFIRST;
lFrfField := lRrfTable.FIELD(1);
lVarValue := lFrfField.VALUE;
MESSAGE('Result:%1',lVarValue);
Assume the value of the first field in the first record of table 23 is '10000' then the result of this function is 10000 with a square before it.
Does anyone have a solution to this?
I already tried lVarValue := FORMAT(lFrfField.VALUE), which works fine, but it is not preferable for other datatypes.
0
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Now I am going to try an other solution where code is always converted to text. Of course does code then always show up as text in the variant, but in my case that's no problem.
IF FORMAT(lFrfField.TYPE) = 'Code'
THEN vVarValue := FORMAT(lFrfField.VALUE)
ELSE vVarValue := lFrfField.VALUE;
I hope other data types don't have similar problems.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!