File.Write and Record

fufikk
Member Posts: 104
Hi,
I'm trying do write a record variable to textfile and then retrive data, field by field.
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?
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?
0
Comments
-
That is how it is converted to text. I would use recordRef and fieldRef. Loop through the fields and write them to text. and when you read them you'll loop through the fieldref and read them back.0
-
Unfortunatelly, I'm using NF 2.6 and these variable types haven't been invented yet
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...0 -
Oh, right before flowfields come flowfilter fields.
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.0 -
fufikk wrote:Unfortunatelly, I'm using NF 2.6 and these variable types haven't been invented yet
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.Kai Kowalewski0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions