- Create XMLPort
- https://docs.microsoft.com/en-us/dynamics-nav/walkthrough--exporting-data-from-tables-to-xml-documents
- Root : Element : Text
- POHeader : Table : Purchase Header
- PO Header fields : Element : Field
- POFields : Table : Purchase Lines
- PO Line Fields : Element : Field
- Create Codeunit to execute XMLPort
ExportPOXML(PO : Text[50])
POHdr.SETFILTER("No.",PO);
IF POHdr.FINDFIRST THEN BEGIN
POXMLFile.CREATE(TEMPORARYPATH + 'PO.xml');
POXMLFile.CREATEOUTSTREAM(XMLStream);
IsExported := XMLPORT.EXPORT(XMLPORT::"PO Export XML", XMLStream,POHdr);
FromFile := POXMLFile.NAME;
ToFile := 'VendorPO.xml';
POXMLFile.CLOSE;
END;
IF IsExported THEN
BEGIN
DOWNLOAD(FromFile,'Download file','C:\Temp','Xml file(*.xml)|*.xml',ToFile);
ERASE(FromFile);
MESSAGE(Text000);
END
ELSE
MESSAGE(Text001);
- Create Button on Page to call codeunit and pass current record
Export PO to XML - OnAction()
Sub.ExportPOXML(Rec."PO Number");
Hi,
ReplyDeleteCan you please tell me on how to do setup to fetch POS sales Transaction from HO on POS..
There is one default web service that is Get_Transaction but it is not working. which POS button need to add to fetch Transaction information from HO server