{"id":432,"date":"2017-08-10T13:57:23","date_gmt":"2017-08-10T11:57:23","guid":{"rendered":"http:\/\/daxvisionerp.com\/?p=432"},"modified":"2025-10-27T08:32:05","modified_gmt":"2025-10-27T08:32:05","slug":"aif-xpp-generate-xml-example-code","status":"publish","type":"post","link":"https:\/\/daxvisionerp.com\/home\/aif-xpp-generate-xml-example-code\/","title":{"rendered":"AIF X++ generate xml example code"},"content":{"rendered":"<p>As part of <a href=\"http:\/\/daxvisionerp.com\/aif-document-service-code-examples\/\">AIF Document Service related examples<\/a>, here you can find how I generate an XML\u00a0using an enhanced file system outbound port. I will have a detailed description that will link to this code.<\/p>\n<p>static void JAD_SCOGenerateXmlVendInvoice(Args _args)<br \/>\n{<br \/>\nAxdSendContext axdSendContext = AxdSendContext::construct();<br \/>\nAifEntityKey aifEntityKey = AifEntityKey::construct();<br \/>\nAifEntityKeyList aifEntityKeyList = AifEntityKeyList::construct();<br \/>\nMap keyData;<br \/>\nAifConstraintList aifConstraintList = new AifConstraintList();<br \/>\nAifConstraint aifConstraint = new AifConstraint();<br \/>\nJAD_VendInvoiceInfoTable vendIIT;<br \/>\nint i,j;<br \/>\nJADSCOVendInvoiceService poService = JADSCOVendInvoiceService::construct();<\/p>\n<p>vendIIT = JAD_VendInvoiceInfoTable::findRecId(5637152829);<br \/>\nkeyData = SysDictTable::getKeyData(vendIIT);<br \/>\naifEntityKey.parmTableId(vendIIT.TableId);<br \/>\naifEntityKey.parmRecId(vendIIT.RecId);<br \/>\naifEntityKey.parmKeyDataMap(keyData);<br \/>\naifEntityKeyList.addEntityKey(aifEntityKey);<br \/>\naxdSendContext.parmXMLDocPurpose(XMLDocPurpose::Original);<br \/>\naxdSendContext.parmSecurity(false);<br \/>\naifConstraint.parmType(AifConstraintType::NoConstraint) ;<br \/>\naifConstraintList.addConstraint(aifConstraint) ;<br \/>\nAifSendService::SubmitDefault( classnum(JADSCOVendInvoiceService),<br \/>\naifEntityKey,<br \/>\naifConstraintList,<br \/>\nAifSendMode::Async,<br \/>\naxdSendContext.pack());<br \/>\ninfo(&#8220;done&#8221;);<br \/>\n}<\/p>\n<h2>Process outbound<\/h2>\n<p>After running the code above, there will be a new record waiting in the AIF Queue (System administration\/Periodic\/Services and Application Integration Framework\/Queue manager).<\/p>\n<p><a href=\"http:\/\/daxvisionerp.com\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-437\" src=\"http:\/\/daxvisionerp.com\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound.png\" alt=\"\" width=\"1469\" height=\"261\" srcset=\"https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound.png 1469w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound-300x53.png 300w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound-1024x182.png 1024w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound-768x136.png 768w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound-1080x192.png 1080w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound-1280x227.png 1280w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound-980x174.png 980w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueBeforeProcessoutbound-480x85.png 480w\" sizes=\"(max-width: 1469px) 100vw, 1469px\" \/><\/a><\/p>\n<p>You also need to call the following code to get the XML document generated.<\/p>\n<p>static void JAD_ProcessOutbound(Args _args)<br \/>\n{<br \/>\nAifOutboundProcessingService aifOutboundProcessingService = new AifOutboundProcessingService();<br \/>\naifOutboundProcessingService.run();<br \/>\n}<\/p>\n<p>After executing the process outbound, click refresh and if you are fast enough or the batch for processing the queue is not yet set up, you will see this in the:<br \/>\n<a href=\"http:\/\/daxvisionerp.com\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-436\" src=\"http:\/\/daxvisionerp.com\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound.png\" alt=\"\" width=\"1368\" height=\"167\" srcset=\"https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound.png 1368w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound-300x37.png 300w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound-1024x125.png 1024w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound-768x94.png 768w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound-1080x132.png 1080w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound-1280x156.png 1280w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound-980x120.png 980w, https:\/\/daxvisionerp.com\/home\/wp-content\/uploads\/2017\/08\/QueueAfterProcessoutbound-480x59.png 480w\" sizes=\"(max-width: 1368px) 100vw, 1368px\" \/><\/a><\/p>\n<p>You can get the XML\u00a0with the buttons of this form, or if the queue is empty than it was most probably processed and the document is in the outbound folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of AIF Document Service related examples, here you can find how I generate an XML\u00a0using an enhanced file system outbound port. I will have a detailed description that will link to this code. static void JAD_SCOGenerateXmlVendInvoice(Args _args) { AxdSendContext axdSendContext = AxdSendContext::construct(); AifEntityKey aifEntityKey = AifEntityKey::construct(); AifEntityKeyList aifEntityKeyList = AifEntityKeyList::construct(); Map keyData; AifConstraintList [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"1080","footnotes":""},"categories":[1],"tags":[],"class_list":["post-432","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":1,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":1413,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/432\/revisions\/1413"}],"wp:attachment":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}