Hi,
Is there a way to import a comma delimited text file using a XMLPort. I need to find a way to import file within RTC. How would an XMLport look like?
it will look like dataport, just the table will be as a root element of type table and the fields will be like elements of type field under the table element. Just study the documentation, you will find what you need. ;-)
The other question I have is: In the codeunit I need to create a XMLPort DataType, instead of 'XMLPort.import(ID,Instream), since I want to transfer/set paramaters before starting the XMLPort.
This is my code, but I'm sure I miss something.
Note: the xml import is basically importing gen jnl line info in Deposits.
GLSetup.GET;
GLSetup.TESTFIELD("Cash Receipts File Name");
vXMLPort.SetFileName(GLSetup."Cash Receipts File Name");
vXMLPort.SetDeposit(DepositHeader);
ImportFile.OPEN(GLSetup."Cash Receipts File Name");
ImportFile.CREATEINSTREAM(vInStream);
vXMLPort.SETSOURCE(vInStream);
vXMLPort.IMPORT;
IF NOT ISSERVICETIER then
ImportFile.CLOSE;
My question is:
- how to set the filename
- is the instream correct
Basically is the whole structure correct?
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
This is my code, but I'm sure I miss something.
Note: the xml import is basically importing gen jnl line info in Deposits.
GLSetup.GET;
GLSetup.TESTFIELD("Cash Receipts File Name");
vXMLPort.SetFileName(GLSetup."Cash Receipts File Name");
vXMLPort.SetDeposit(DepositHeader);
ImportFile.OPEN(GLSetup."Cash Receipts File Name");
ImportFile.CREATEINSTREAM(vInStream);
vXMLPort.SETSOURCE(vInStream);
vXMLPort.IMPORT;
IF NOT ISSERVICETIER then
ImportFile.CLOSE;
My question is:
- how to set the filename
- is the instream correct
Basically is the whole structure correct?