{"title":"Codeunit 30362 Shpfy Posted Invoice Export, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/30362-shpfy-posted-invoice-export/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":30362,"name":"Shpfy Posted Invoice Export","app":"Shopify Connector","url":"https://jonas-paprotka.de/ref/codeunit/30362-shpfy-posted-invoice-export/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/30362-shpfy-posted-invoice-export/source/","path":"src/Apps/W1/Shopify/App/src/Invoicing/Codeunits/ShpfyPostedInvoiceExport.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:30159":{"name":"Shpfy Draft Orders API","url":"https://jonas-paprotka.de/ref/codeunit/30159-shpfy-draft-orders-api/"},"codeunit:30361":{"name":"Shpfy Fulfillment API","url":"https://jonas-paprotka.de/ref/codeunit/30361-shpfy-fulfillment-api/"},"codeunit:30157":{"name":"Shpfy Json Helper","url":"https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/"},"codeunit:30313":{"name":"Shpfy Skipped Record","url":"https://jonas-paprotka.de/ref/codeunit/30313-shpfy-skipped-record/"},"table:112":{"name":"Sales Invoice Header","url":"https://jonas-paprotka.de/ref/table/112-sales-invoice-header/"},"table:30118":{"name":"Shpfy Order Header","url":"https://jonas-paprotka.de/ref/table/30118-shpfy-order-header/"},"table:30119":{"name":"Shpfy Order Line","url":"https://jonas-paprotka.de/ref/table/30119-shpfy-order-line/"},"table:30161":{"name":"Shpfy Invoice Header","url":"https://jonas-paprotka.de/ref/table/30161-shpfy-invoice-header/"},"codeunit:30259":{"name":"Shpfy BC Document Type Convert","url":"https://jonas-paprotka.de/ref/codeunit/30259-shpfy-bc-document-type-convert/"},"table:30146":{"name":"Shpfy Doc. Link To Doc.","url":"https://jonas-paprotka.de/ref/table/30146-shpfy-doc-link-to-doc/"},"page:30162":{"name":"Shpfy Payment Terms Mapping","url":"https://jonas-paprotka.de/ref/page/30162-shpfy-payment-terms-mapping/"}},"procs":[{"name":"OnRun","line":27,"kind":"trigger","steps":[[29,"call","ExportPostedSalesInvoiceToShopify",1]]},{"name":"SetShop","line":45,"kind":"procedure","access":"internal","params":1,"steps":[[48,"ext","codeunit",30159,"SetShop",1],[49,"ext","codeunit",30361,"SetShop",1]]},{"name":"ExportPostedSalesInvoiceToShopify","line":60,"kind":"procedure","access":"internal","params":1,"steps":[[71,"call","IsInvoiceExportable",1],[72,"call","SetSalesInvoiceShopifyOrderInformation",3],[76,"call","MapPostedSalesInvoiceData",4],[78,"ext","codeunit",30159,"CreateDraftOrder",3],[80,"call","SetSalesInvoiceShopifyOrderInformation",3],[83,"ext","codeunit",30159,"CompleteDraftOrder",1],[85,"call","IsSuccess",1],[86,"ext","codeunit",30157,"GetValueAsBigInteger",2],[87,"ext","codeunit",30157,"GetValueAsText",2],[89,"ext","codeunit",30361,"GetFulfillmentOrderIds",1],[90,"call","CreateFulfillmentsForShopifyOrder",1],[91,"call","CreateShopifyInvoiceHeader",1],[92,"call","SetSalesInvoiceShopifyOrderInformation",3],[93,"call","AddDocumentLinkToBCDocument",1],[95,"call","SetSalesInvoiceShopifyOrderInformation",3]]},{"name":"CreateFulfillmentsForShopifyOrder","line":98,"kind":"procedure","access":"local","params":1,"steps":[[103,"ext","codeunit",30361,"CreateFulfillment",1]]},{"name":"IsInvoiceExportable","line":106,"kind":"procedure","access":"local","params":1,"steps":[[115,"ext","codeunit",30313,"LogSkippedRecord",3],[120,"call","ShopifyPaymentTermsExists",1],[121,"ext","codeunit",30313,"LogSkippedRecord",3],[126,"ext","codeunit",30313,"LogSkippedRecord",3],[130,"call","CheckCustomerTemplates",1],[131,"ext","codeunit",30313,"LogSkippedRecord",3],[135,"call","CheckSalesInvoiceHeaderLines",1]]},{"name":"CheckSalesInvoiceHeaderLines","line":168,"kind":"procedure","access":"local","params":1,"steps":[[175,"ext","codeunit",30313,"LogSkippedRecord",3],[185,"ext","codeunit",30313,"LogSkippedRecord",3],[190,"ext","codeunit",30313,"LogSkippedRecord",3]]},{"name":"SetSalesInvoiceShopifyOrderInformation","line":198,"kind":"procedure","access":"local","params":3,"steps":[[200,"validate",112,"Shpfy Order Id"],[201,"validate",112,"Shpfy Order No."],[202,"write",112,"Modify",1]]},{"name":"MapPostedSalesInvoiceData","line":205,"kind":"procedure","access":"internal","params":4,"steps":[[214,"call","MapSalesInvoiceHeader",2],[220,"call","MapSalesInvoiceLine",4]]},{"name":"MapSalesInvoiceHeader","line":224,"kind":"procedure","access":"local","params":2,"steps":[[235,"call","MapCurrencyCode",1],[242,"call","IsInvoiceUnpaid",1],[244,"call","MapBillToInformation",2],[245,"call","MapShipToInformation",2],[247,"write",30118,"Insert"]]},{"name":"MapSalesInvoiceLine","line":306,"kind":"procedure","access":"local","params":4,"steps":[[324,"write",30118,"Modify"],[326,"call","MapTaxLine",2],[328,"write",30119,"Insert"]]},{"name":"IsSuccess","line":349,"kind":"procedure","access":"local","params":1,"steps":[[351,"ext","codeunit",30157,"GetJsonArray",2]]},{"name":"CreateShopifyInvoiceHeader","line":354,"kind":"procedure","access":"local","params":1,"steps":[[359,"validate",30161,"Shopify Order Id"],[360,"write",30161,"Insert",1]]},{"name":"AddDocumentLinkToBCDocument","line":363,"kind":"procedure","access":"local","params":1,"steps":[[371,"ext","codeunit",30259,"Convert",1],[373,"write",30146,"Insert",1]]},{"name":"ConfigurePaymentTermsMapping","line":376,"kind":"procedure","access":"internal","params":1,"steps":[[383,"run","page",30162]]}]}