Hi,
I'm trying do write a record variable to textfile and then retrive data, field by field.
f.textmode(true);
f.create(...);
f.write(record);
f.close;
and the file is created, but the order of fields in this file is different from the order of fields in this table (by field no.).
I've noticed that flowfields are shifted to the end, but still regular fields are scrambled.
Does anyone know why or how this happens?
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Anyway, I've noticed the way NF writes rec to file, the first fields come from the primary key, then comes the rest of "regular" fileds and finally the flowfields.
This information makes it a whole lot easier, but is there a way to reach from C/AL list of PK fields in correct order?
The Field table doesn't seem to have that info...
So the record is dumped with fields in following order:
- Primary key fields (in the order you see in keys in table designer) - Regular fields (ordered by fieldNo) - Flowfilter fields (ordered by fieldNo) - Flowfield fields (ordered by fieldNo)
fields' values are separated by TAB. Flowfields need to be calculated before dumped.
The order of the fields in a record can be checked in the C/AL Symbol Menu Form when the rec or record variable is selected in the left column.