{"id":447,"date":"2017-08-23T09:13:39","date_gmt":"2017-08-23T07:13:39","guid":{"rendered":"http:\/\/daxvisionerp.com\/?p=447"},"modified":"2025-10-27T08:28:16","modified_gmt":"2025-10-27T08:28:16","slug":"example-xpp-job-call-aif-document-service-create-easier-debugging","status":"publish","type":"post","link":"https:\/\/daxvisionerp.com\/home\/example-xpp-job-call-aif-document-service-create-easier-debugging\/","title":{"rendered":"Example X++ job to call an AIF Document Service create (for easier debugging)"},"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 an example X++ code to call AIF Document Service. This is useful for example when you want to debug your AIF Document Service code.<\/p>\n<p>static void JAD_SCOCreateInvoice(Args _args)<br \/>\n{<br \/>\nJADSCOVendInvoiceService invoiceService;<br \/>\nJADSCOInvoice invoice;<br \/>\nJADSCOInvoice_JADVendInvoiceInfoTable infoTable;<br \/>\nJADSCOInvoice_JADVendInvoiceInfoLine infoLine;<br \/>\nAifEntityKeyList entityKeyList;<br \/>\nNum num;<\/p>\n<p>\/\/ Create the service instance<br \/>\ninvoiceService = JADSCOVendInvoiceService::construct();<\/p>\n<p>\/\/ Create the document object<br \/>\ninvoice = new JADSCOInvoice();<br \/>\ninvoice.createJADVendInvoiceInfoTable(); \/\/ Create the JADVendInvoiceInfoTable list<br \/>\ninfoTable = invoice.parmJADVendInvoiceInfoTable().addNew(); \/\/ Add JADVendInvoiceInfoTable instance to JADVendInvoiceInfoTable list<\/p>\n<p>\/\/ Initialize the JADVendInvoiceInfoTable instance<br \/>\ninfoTable.parmPurchId(&#8216;PO000001&#8217;);<br \/>\ninfoTable.parmTransDate(mkDate(23,8,2017));<br \/>\ninfoTable.parmInvoiceId(&#8216;InsideAXAugust23_1&#8217;);<br \/>\ninfoTable.parmDocumentDate(mkDate(23,8,2017));<br \/>\ninfoTable.parmInvoiceAccount(&#8216;V001900&#8217;);<br \/>\ninfoTable.parmPurchaseType(PurchaseType::Purch);<br \/>\ninfoTable.parmSCOCaseId(30000);<\/p>\n<p>\/\/ Create the infoLines<br \/>\ninfoLine = new JADSCOInvoice_JADVendInvoiceInfoLine();<\/p>\n<p>\/\/ Initialize the infoLines instance<br \/>\ninfoLine.parmItemId(&#8216;ITEM0000001&#8217;);<br \/>\ninfoLine.parmLineAmount(27.10);<br \/>\ninfoLine.parmcurrencyCode(&#8216;GBP&#8217;);<br \/>\ninfoLine.parmPurchaseLineLineNumber(40);<br \/>\ninfoLine.parmReceiveNow(1);<br \/>\ninfoLine.parmDimEmployee(&#8216;00000007&#8217;);<br \/>\ninfoLine.parmDimCostCenter(&#8216;0001&#8217;);<br \/>\ninfoLine.parmDimPurpose(&#8216;Purpose001&#8217;);<br \/>\ninfoLine.parmDimSite(&#8216;SITE01&#8217;);<\/p>\n<p>infoTable.createJADVendInvoiceInfoLine().add(infoLine);<\/p>\n<p>\/\/ Create<br \/>\nentityKeyList = invoiceService.create(invoice);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of AIF Document Service related examples, here you can find an example X++ code to call AIF Document Service. This is useful for example when you want to debug your AIF Document Service code. static void JAD_SCOCreateInvoice(Args _args) { JADSCOVendInvoiceService invoiceService; JADSCOInvoice invoice; JADSCOInvoice_JADVendInvoiceInfoTable infoTable; JADSCOInvoice_JADVendInvoiceInfoLine infoLine; AifEntityKeyList entityKeyList; Num num; \/\/ Create [&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-447","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/447","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=447"}],"version-history":[{"count":1,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"predecessor-version":[{"id":1408,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/posts\/447\/revisions\/1408"}],"wp:attachment":[{"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daxvisionerp.com\/home\/wp-json\/wp\/v2\/tags?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}