I want to step through all the fields in a table, to see where there are any data (across companies in a database). I'm aware that Fieldref and RecRef can do the trick, but how?
1) If there is some record, there are some data (you cannot say that if the field is empty, that there is no data, or if in integer is 0, it means no data..., if some record exists, there are data...)
2) If there is some record in the table you can find out in File-Database-Informations-Tables
3) This table is "across companies".
1) If there is some record, there are some data (you cannot say that if the field is empty, that there is no data, or if in integer is 0, it means no data..., if some record exists, there are data...)
No, I want to check it on field basis: If the datattype is Date, the field isn't empty if the fieldvalue <> 0D, if the type code the field isn't empty if it <>'' etc.
item as record subtype item
refItem as recordref
fldItemFields as fieldref
Ctr as integer
tmpClass as Text 100
tmpType as text 200
tmpValue as text 1024
IF Item.FIND('-') THEN REPEAT
refItem.GETTABLE(Item);
FOR Ctr := 1 TO refItem.FIELDCOUNT DO BEGIN
fldItemFields := refItem.FIELDINDEX(Ctr);
tmpClass := FORMAT(fldItemFields.CLASS);
tmpType := FORMAT(fldItemFields.TYPE);
tmpValue := fldItemFields.VALUE;
MESSAGE(tmpClass);
MESSAGE(tmpType);
MESSAGE(tmpValue);
END;
UNTIL Item.NEXT = 0;
Comments
2) If there is some record in the table you can find out in File-Database-Informations-Tables
3) This table is "across companies".
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No, I want to check it on field basis: If the datattype is Date, the field isn't empty if the fieldvalue <> 0D, if the type code the field isn't empty if it <>'' etc.
declare this variables:
item as record subtype item
refItem as recordref
fldItemFields as fieldref
Ctr as integer
tmpClass as Text 100
tmpType as text 200
tmpValue as text 1024