txtTempFilename:=FileManagement.ServerTempFileName('Encript.txt'); File1.CREATE(txtTempFilename); File1.CREATEOUTSTREAM(Outstream1); Outstream1.WRITETEXT(FORMAT(Plant)+','+ OurVendorCode +','+ CompGSTNo+','+ HSNCODE+','+FORMAT(0)+','+"PartNo." +','+"External Document No."+','+FORMAT("Line Item No")+ ','+"No." +','+FORMAT(PostingDate)+','+DELCHR(FORMAT(Qty,0,'<Integer Thousand><Decimal,3>'),'=',',')+','+DELCHR(FORMAT(Rate,0,'<Integer Thousand><Decimal,3>'),'=',',')+ ','+DELCHR(FORMAT(Amount,0,'<Integer Thousand><Decimal,3>'),'=',',')+','+FORMAT(0)+','+FORMAT(0)+','+FORMAT(0)+ ','+DELCHR(FORMAT(Amount,0,'<Integer Thousand><Decimal,3>'),'=',',')+','+FORMAT(0)+','+DELCHR(FORMAT(Amount,0,'<Integer Thousand><Decimal,3>'),'=',',')+ ','+DELCHR(FORMAT(vCGSTRate,0,'<Integer Thousand><Decimal,3>'),'=',',')+','+DELCHR(FORMAT(vCGSTAmount,0,'<Integer Thousand><Decimal,3>'),'=',',')+ ','+DELCHR(FORMAT(vSGSTRate,0,'<Integer Thousand><Decimal,3>'),'=',',')+','+DELCHR(FORMAT(vSGSTAmount,0,'<Integer Thousand><Decimal,3>'),'=',',')+ ','+DELCHR(FORMAT(vIGSTRate,0,'<Integer Thousand><Decimal,0>'),'=',',')+','+DELCHR(FORMAT(vIGSTAmount,0,'<Integer Thousand><Decimal,0>'),'=',',')+','+FORMAT(0)+ ','+FORMAT(0)+','+DELCHR(FORMAT("Amount to Customer",0,'<Integer Thousand><Decimal,3>'),'=',',')+','+','+','+"Vehicle No."+','+ PackingDetails +','); Outstream1.WRITETEXT; File1.CLOSE; FileManagement.DownloadToFile(txtTempFilename,'C:\NAV EDI\Encript.txt'); MESSAGE('EDI File Crearted Successfully');for multiple posted sales invoice ???
Answers
I'm not sure to understand your problem, but you need to loop trough your marked/checked invoices :
Talent Business Solutions
Technical Expert of Microsoft Dynamics 365 Business Central
Website | Mail | LinkedIn