Quantcast
Channel: Microsoft Dynamics NAV
Viewing all articles
Browse latest Browse all 64865

Forum Post: RE: Export purchase lines to text

$
0
0
So now I have this, TXT - OnAction() // LACPOS001 varTab:=9; txtTab:=FORMAT(varTab); Serverfilename := FileManagement.ServerTempFileName('txt'); ClientFilePath := 'C:\Catia\teste.txt'; MyFile.CREATE(Serverfilename); MyFile.CREATEOUTSTREAM(MyOutStream); PurchaseLine.SETRANGE("Document Type",PurchaseLine."Document Type"::Order); PurchaseLine.SETRANGE("Document No.", PurchaseHeader."No."); MESSAGE('numero documento %1,',PurchaseHeader."No."); MESSAGE('encontrou ? %1,',PurchaseLine.FINDSET); IF PurchaseLine.FINDSET THEN REPEAT counter := counter+1; MyOutStream.WRITETEXT(PurchaseLine."No." + txtTab + FORMAT(PurchaseLine."Data Tabela") + txtTab + FORMAT(PurchaseLine.PVP) + txtTab + FORMAT(PurchaseLine.Quantity)); MyOutStream.WRITETEXT(); // This command is to move to next line UNTIL PurchaseLine.NEXT = 0; MyFile.CLOSE;// To end the writing and write out to the file. FileManagement.DownloadToFile(Serverfilename,ClientFilePath); But is not writing. I think I'm not getting right the "Document No". Because in my messages i can't find any records.

Viewing all articles
Browse latest Browse all 64865