Skip to main content

Posts

Showing posts with the label xml

Creating sales orders from XML

This document has been migrated from TechNet.Navision.com - In this article we will show how a sales order may be created using the XML interface. We show a simple XML file containing the sales order, and describe how it ends up as a sales order in Axapta. Consider a scenario where an application needs to create a sales order in Axapta. This application could be an MS office application (e.g a spreadsheet containing the sales order lines) or a web site created in another environment, that needs to access Axapta to do create a sales order. This sort of integration is easily done with XML, as we show in this example. Consider a sales order: 4010 4012 OL-1000 3 OL-1500 4 PL-2500/Art 5 In this sales order, the customer with account number 4010 is ordering 4 Ol-1000, 4 OL-1500 and 5 PL-2500/ART. Although this is a simplified sales order, it will suffice for the presentation herein. Consider now the job below, where the XML document is read, the information ex...

AX Data Export in XML file

static void XMLExport(Args _args) { XmlDocument doc; XmlElement nodeXml; XmlElement nodeTable; XmlElement nodeAccount; XmlElement nodeName; XmlElement nodeItemName; XmlElement nodeModelGroup; XmlElement nodeDimGroup; InventTable inventTable; #define.filename(‘C:\\Users\\varun.garg\\Desktop\\test.xml’) ; doc = XmlDocument::newBlank(); nodeXml = doc.createElement(‘xml’); doc.appendChild(nodeXml); while select inventTable { nodeTable = doc.createElement(tablestr(InventTable)); nodeTable.setAttribute( fieldstr(InventTable, RecId), int642str(inventTable.RecId)); nodeXml.appendChild(nodeTable); nodeAccount = doc.createElement( fieldstr(InventTable, ItemId)); nodeAccount.appendChild( doc.createTextNode(inventTable.ItemId)); nodeTable.appendChild(nodeAccount); nodeName = doc.createEleme...