{"title":"Codeunit 6166 EDoc Import PEPPOL BIS 3.0, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/6166-edoc-import-peppol-bis-3-0/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":6166,"name":"EDoc Import PEPPOL BIS 3.0","app":"E-Document Core","url":"https://jonas-paprotka.de/ref/codeunit/6166-edoc-import-peppol-bis-3-0/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/6166-edoc-import-peppol-bis-3-0/source/","path":"src/Apps/W1/EDocument/App/src/Format/EDocImportPEPPOLBIS30.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":{"table:1235":{"name":"XML Buffer","url":"https://jonas-paprotka.de/ref/table/1235-xml-buffer/"},"codeunit:4100":{"name":"Temp Blob","url":"https://jonas-paprotka.de/ref/codeunit/4100-temp-blob/"},"codeunit:6109":{"name":"E-Document Import Helper","url":"https://jonas-paprotka.de/ref/codeunit/6109-e-document-import-helper/"},"codeunit:6148":{"name":"E-Document Helper","url":"https://jonas-paprotka.de/ref/codeunit/6148-e-document-helper/"},"table:38":{"name":"Purchase Header","url":"https://jonas-paprotka.de/ref/table/38-purchase-header/"},"codeunit:6169":{"name":"E-Doc. Attachment Processor","url":"https://jonas-paprotka.de/ref/codeunit/6169-e-doc-attachment-processor/"},"table:1173":{"name":"Document Attachment","url":"https://jonas-paprotka.de/ref/table/1173-document-attachment/"},"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"},"codeunit:4110":{"name":"Base64 Convert","url":"https://jonas-paprotka.de/ref/codeunit/4110-base64-convert/"},"codeunit:419":{"name":"File Management","url":"https://jonas-paprotka.de/ref/codeunit/419-file-management/"}},"procs":[{"name":"ParseBasicInfo","line":15,"kind":"procedure","params":2,"steps":[[22,"write",1235,"DeleteAll"],[23,"ext","codeunit",4100,"CreateInStream",2],[24,"ext","table",1235,"LoadFromStream",1],[31,"call","GetDocumentType",2],[33,"call","ParseInvoiceBasicInfo",3],[35,"call","ParseCreditMemoBasicInfo",3]]},{"name":"ParseCompleteInfo","line":39,"kind":"procedure","params":4,"steps":[[45,"write",1235,"DeleteAll"],[46,"ext","codeunit",4100,"CreateInStream",2],[47,"ext","table",1235,"LoadFromStream",1],[52,"call","GetDocumentType",2],[54,"call","CreateInvoice",5],[56,"call","CreateCreditMemo",5]]},{"name":"ParseInvoiceBasicInfo","line":60,"kind":"procedure","access":"local","params":3,"steps":[[66,"call","GetNodeByPath",2],[67,"call","ParseAccountingSupplierParty",3],[68,"call","ParseAccountingCustomerParty",3],[70,"call","GetNodeByPath",2],[73,"call","GetNodeByPath",2],[77,"call","GetNodeByPath",2],[78,"call","GetNodeByPath",2],[80,"call","GetNodeByPath",2],[82,"call","GetNodeByPath",2]]},{"name":"ParseCreditMemoBasicInfo","line":87,"kind":"procedure","access":"local","params":3,"steps":[[93,"call","GetNodeByPath",2],[94,"call","ParseAccountingSupplierParty",3],[95,"call","ParseAccountingCustomerParty",3],[97,"call","GetNodeByPath",2],[100,"call","GetNodeByPath",2],[104,"call","GetNodeByPath",2],[105,"call","GetNodeByPath",2],[107,"call","GetNodeByPath",2],[109,"call","GetNodeByPath",2]]},{"name":"ParseAccountingSupplierParty","line":114,"kind":"procedure","access":"local","params":3,"steps":[[126,"call","GetNodeAttributeByPath",2],[126,"call","GLNSchemeId",0],[127,"call","GetNodeByPath",2],[129,"call","GetNodeByPath",2],[130,"ext","codeunit",6109,"FindVendor",3],[134,"call","GetNodeAttributeByPath",2],[137,"ext","codeunit",6148,"GetEdocumentService",2],[138,"ext","codeunit",6109,"FindVendorByServiceParticipant",2],[143,"call","GetNodeByPath",2],[144,"call","GetNodeByPath",2],[145,"ext","codeunit",6109,"FindVendorByNameAndAddress",2],[149,"ext","codeunit",6109,"GetVendor",2]]},{"name":"ParseAccountingCustomerParty","line":156,"kind":"procedure","access":"local","params":3,"steps":[[167,"call","GetNodeByPath",2],[168,"call","GetNodeByPath",2],[169,"call","GetNodeAttributeByPath",2],[170,"call","GetNodeByPath",2],[172,"call","GetNodeByPath",2],[179,"call","GetNodeAttributeByPath",2],[180,"call","GetNodeByPath",2]]},{"name":"CreateInvoice","line":190,"kind":"procedure","access":"local","params":5,"steps":[[198,"call","GetNodeByPath",2],[199,"call","GetNodeByPath",2],[201,"write",38,"Insert"],[206,"call","ParseInvoice",8],[211,"ext","codeunit",4100,"CreateInStream",2],[212,"ext","codeunit",6169,"Insert",3],[212,"ext","table",1173,"FindUniqueFileName",2],[217,"write",39,"Insert"],[219,"write",38,"Modify"],[222,"call","CreateInvoiceAllowanceChargeLines",5]]},{"name":"CreateCreditMemo","line":225,"kind":"procedure","access":"local","params":5,"steps":[[233,"call","GetNodeByPath",2],[234,"write",38,"Insert"],[239,"call","ParseCreditMemo",8],[244,"ext","codeunit",4100,"CreateInStream",2],[245,"ext","codeunit",6169,"Insert",3],[245,"ext","table",1173,"FindUniqueFileName",2],[250,"write",39,"Insert"],[251,"write",38,"Modify"],[254,"call","CreateInvoiceAllowanceChargeLines",5]]},{"name":"CreateInvoiceAllowanceChargeLines","line":257,"kind":"procedure","access":"local","params":5,"steps":[[272,"call","SetGLAccountAndInsertLine",3],[292,"call","SetGLAccountAndInsertLine",3]]},{"name":"SetGLAccountAndInsertLine","line":295,"kind":"procedure","access":"local","params":3,"steps":[[301,"ext","codeunit",6109,"FindGLAccountForLine",2],[303,"write",39,"Insert"]]},{"name":"ParseCreditMemo","line":312,"kind":"procedure","access":"local","params":8,"steps":[[354,"ext","codeunit",4100,"CreateInStream",2],[355,"ext","codeunit",6169,"Insert",3],[355,"ext","table",1173,"FindUniqueFileName",2],[364,"ext","codeunit",4100,"CreateOutStream",2],[368,"ext","codeunit",4110,"FromBase64",2],[371,"validate",1173,"File Extension"],[371,"call","DetermineFileType",1],[377,"write",39,"Insert"],[417,"call","SetLineType",2],[419,"event","OnAfterParseCreditMemo",0]]},{"name":"ParseInvoice","line":426,"kind":"procedure","access":"local","params":8,"steps":[[466,"ext","codeunit",4100,"CreateInStream",2],[467,"ext","codeunit",6169,"Insert",3],[467,"ext","table",1173,"FindUniqueFileName",2],[476,"ext","codeunit",4100,"CreateOutStream",2],[480,"ext","codeunit",4110,"FromBase64",2],[483,"validate",1173,"File Extension"],[483,"call","DetermineFileType",1],[489,"write",39,"Insert"],[530,"call","SetLineType",2],[532,"event","OnAfterParseInvoice",0]]},{"name":"SetFileExt","line":613,"kind":"procedure","access":"local","params":2,"steps":[[619,"ext","codeunit",419,"GetExtension",1]]}]}