Hi,
I have create an XMLport to insert Sales Headers into the database.
As I'm new to XMLport I used this walkthrough as basis:
https://msdn.microsoft.com/en-us/library/hh165768(v=nav.90).aspx
To run the XMLport I used the following C/AL code:
SalesOrderXmlFile.OPEN('C:\NAV_DATAIMPORT\NewSalesOrder.xml');
SalesOrderXmlFile.CREATEINSTREAM(XmlStream);
IsImported := XMLPORT.IMPORT(XMLPORT::Latest_Test, XmlStream);
SalesOrderXmlFile.CLOSE;
IF (IsImported = TRUE) THEN
MESSAGE('The import from XML is complete.')
ELSE
MESSAGE(GETLASTERRORTEXT);
I have one record in the test XML file for a Sales Header with no. TEST02 (we use manual numbering).
When I try to import an error is generated instead of the record being added to the database: "The Sales Header does not exist. Identification fields and values: Document Type='Order',No.='TEST02'". As inserting a record is exactly what I'm trying to accomplish this error doesn't make sense to me.
Any ideas?
*This post is locked for comments
I have the same question (0)