Hi!
How is it possible to export information from Header-table and Line-table (eg. Purchase Header and Purchase Line) to txt-file so, that on the txt-file there is first information from the Header-table and after that information from the Line-table. The information on the txt-file have to be something like that:
1. Header-table information from order 1
1. Line-table information from order 1 (here can be many lines)
2. Header-table information from order 2
2. Line-table information from order 2 (here can be many lines)
3. Header-table information from order 3
3. Line-table information from order 3 (here can be many lines)
etc.
I hope you get the idea and help me with this one..
-Imaspal
Comments
Dataport - i'm not so sure about.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Create a report or Codeunit and loop through header then through line.
Your code should like this.
MyFile.create('c:\test.txt');
MyFile.textmode(true);
MyFile.WriteMode(true);
If SalesHeader.findset then repeat
MyFile.write(SalesHeader."No." + ' ' + SalesHeader."Sell-to customer No.");
SalesLine.setrange("Document type",SalesHeader."Document type");
SalesLine.setrange("Document No.", SalesHeader."No.");
if SalesLine.findset then repeat
MyFile.write(SalesLine."No." + ' ' + SalesHeader."description");
until SalesLine.next = 0;
until SalesHeader.next = 0;
MyFile.close
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
-Imaspal
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
then you link them by setting on the lines item its DataItemLink property
(the DataItemLinkReference is set automatically by designer)
take a look at report 107 for example to see how Sales Lines is linked to Customer via DataItemLink property:
"Sales Line"."Bill-to Customer No."=Customer."No.",
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n