{"title":"Codeunit 6156 E-Doc. DED PEPPOL Pre-Mapping, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/6156-e-doc-ded-peppol-pre-mapping/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":6156,"name":"E-Doc. DED PEPPOL Pre-Mapping","app":"E-Document Core","url":"https://jonas-paprotka.de/ref/codeunit/6156-e-doc-ded-peppol-pre-mapping/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/6156-e-doc-ded-peppol-pre-mapping/source/","path":"src/Apps/W1/EDocument/App/src/DataExchange/PEPPOL Data Exchange Definition/EDocDEDPEPPOLPreMapping.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:1214":{"name":"Intermediate Data Import","url":"https://jonas-paprotka.de/ref/table/1214-intermediate-data-import/"},"table:6121":{"name":"E-Document","url":"https://jonas-paprotka.de/ref/table/6121-e-document/"},"codeunit:6109":{"name":"E-Document Import Helper","url":"https://jonas-paprotka.de/ref/codeunit/6109-e-document-import-helper/"},"table:2000000026":{"name":"Integer","url":"https://jonas-paprotka.de/ref/table/2000000026-integer/"},"table:700":{"name":"Error Message","url":"https://jonas-paprotka.de/ref/table/700-error-message/"},"table:1251":{"name":"Text-to-Account Mapping","url":"https://jonas-paprotka.de/ref/table/1251-text-to-account-mapping/"}},"procs":[{"name":"OnRun","line":42,"kind":"trigger","steps":[[50,"call","FindDistinctRecordNos",4],[57,"call","ValidateCurrency",2],[58,"call","SetDocumentType",3],[60,"call","FindBuyFromVendor",2],[61,"call","FindPayToVendor",2],[62,"call","FindInvoiceToApplyTo",2],[64,"call","PersistHeaderData",3],[66,"call","ProcessLines",3],[68,"call","ApplyInvoiceCharges",1]]},{"name":"ValidateCurrency","line":72,"kind":"procedure","access":"local","params":2,"steps":[[83,"call","LogErrorMessage",4],[86,"ext","table",1214,"GetEntryValue",5],[88,"call","LogSimpleErrorMessage",2],[97,"write",1214,"Modify"],[104,"call","LogSimpleErrorMessage",2],[108,"write",1214,"DeleteAll"],[117,"call","LogSimpleErrorMessage",2],[121,"write",1214,"DeleteAll"]]},{"name":"PersistHeaderData","line":124,"kind":"procedure","access":"local","params":3,"steps":[[137,"validate",6121,"Bill-to/Pay-to No."],[139,"validate",6121,"Bill-to/Pay-to No."],[141,"write",6121,"Modify"]]},{"name":"FindBuyFromVendor","line":144,"kind":"procedure","access":"local","params":2,"steps":[[164,"ext","table",1214,"GetEntryValue",5],[165,"ext","codeunit",6109,"FindVendorById",1],[167,"call","UpdateIntermediateRecord",4],[169,"ext","table",1214,"GetEntryValue",5],[170,"ext","codeunit",6109,"FindVendorByNo",1],[172,"call","UpdateIntermediateRecord",4],[175,"ext","table",1214,"GetEntryValue",5],[177,"ext","table",1214,"FindEntry",5],[189,"ext","codeunit",6109,"FindVendorByGLN",1],[191,"call","UpdateIntermediateRecord",4],[203,"ext","table",1214,"FindEntry",5],[214,"ext","codeunit",6109,"FindVendorByBankAccount",3],[216,"call","UpdateIntermediateRecord",4],[218,"ext","codeunit",6109,"FindVendorByPhoneNo",1],[220,"call","UpdateIntermediateRecord",4],[222,"ext","codeunit",6109,"FindVendorByNameAndAddress",2],[224,"call","UpdateIntermediateRecord",4],[227,"ext","codeunit",6109,"FindVendorByVATRegistrationNo",1],[229,"call","UpdateIntermediateRecord",4],[233,"ext","codeunit",6109,"FindVendorByBankAccount",3],[235,"call","UpdateIntermediateRecord",4],[237,"ext","codeunit",6109,"FindVendorByPhoneNo",1],[239,"call","UpdateIntermediateRecord",4],[241,"ext","codeunit",6109,"FindVendorByNameAndAddress",2],[243,"call","UpdateIntermediateRecord",4],[247,"call","LogErrorMessage",4]]},{"name":"FindPayToVendor","line":251,"kind":"procedure","access":"local","params":2,"steps":[[263,"ext","table",1214,"FindEntry",5],[280,"ext","codeunit",6109,"FindVendorByNameAndAddress",2],[282,"call","UpdateIntermediateRecord",4],[288,"ext","codeunit",6109,"FindVendorByGLN",1],[290,"call","UpdateIntermediateRecord",4],[293,"ext","codeunit",6109,"FindVendorByVATRegistrationNo",1],[295,"call","UpdateIntermediateRecord",4],[298,"call","LogErrorMessage",4]]},{"name":"UpdateIntermediateRecord","line":302,"kind":"procedure","access":"local","params":4,"steps":[[306,"ext","table",1214,"InsertOrUpdateEntry",6]]},{"name":"FindInvoiceToApplyTo","line":310,"kind":"procedure","access":"local","params":2,"steps":[[318,"ext","table",1214,"GetEntryValue",5],[326,"ext","table",1214,"InsertOrUpdateEntry",6],[328,"ext","table",1214,"InsertOrUpdateEntry",6],[338,"call","LogErrorMessage",4],[345,"call","LogErrorMessage",4]]},{"name":"ProcessLines","line":349,"kind":"procedure","access":"local","params":3,"steps":[[351,"call","FindDistinctRecordNos",4],[353,"call","InsertLineForTotalDocumentAmount",4]]},{"name":"InsertLineForTotalDocumentAmount","line":358,"kind":"procedure","access":"local","params":4,"steps":[[368,"event","OnBeforeInsertLineForTotalDocumentAmount",1],[375,"ext","table",1214,"GetEntryValue",5],[379,"ext","table",1214,"InsertOrUpdateEntry",6],[381,"ext","table",1214,"InsertOrUpdateEntry",6],[383,"ext","table",1214,"InsertOrUpdateEntry",6],[384,"call","GetTotalAmountExclVAT",2],[385,"call","FindGLAccountForLine",4]]},{"name":"GetTotalAmountExclVAT","line":388,"kind":"procedure","access":"local","params":2,"steps":[[393,"ext","table",1214,"FindEntry",5],[394,"call","LogSimpleErrorMessage",2]]},{"name":"FindGLAccountForLine","line":400,"kind":"procedure","access":"local","params":4,"steps":[[409,"ext","table",1214,"GetEntryValue",5],[411,"ext","table",1214,"GetEntryValue",5],[414,"call","FindAppropriateGLAccount",5],[417,"ext","table",1214,"InsertOrUpdateEntry",6],[419,"ext","table",1214,"InsertOrUpdateEntry",6]]},{"name":"FindDistinctRecordNos","line":426,"kind":"procedure","access":"local","params":4,"steps":[[433,"write",2000000026,"DeleteAll"],[445,"write",2000000026,"Insert"]]},{"name":"ApplyInvoiceCharges","line":450,"kind":"procedure","access":"local","params":1,"steps":[[498,"call","InsertChargeLineField",4],[499,"call","InsertChargeLineField",4],[500,"call","InsertChargeLineField",4],[501,"call","InsertChargeLineField",4],[502,"call","InsertChargeLineField",4]]},{"name":"InsertChargeLineField","line":508,"kind":"procedure","access":"local","params":4,"steps":[[514,"write",1214,"Insert"]]},{"name":"LogErrorMessage","line":517,"kind":"procedure","access":"local","params":4,"steps":[[523,"ext","table",700,"SetContext",1],[524,"ext","table",700,"LogMessage",4]]},{"name":"LogSimpleErrorMessage","line":527,"kind":"procedure","access":"local","params":2,"steps":[[533,"ext","table",700,"SetContext",1],[534,"ext","table",700,"LogSimpleMessage",2]]},{"name":"SetDocumentType","line":537,"kind":"procedure","access":"local","params":3,"steps":[[548,"ext","table",1214,"FindEntry",5],[549,"call","LogErrorMessage",4],[550,"call","ConstructDocumenttypeUnknownErr",0],[553,"call","GetDocumentTypeOptionString",1],[554,"call","GetDocumentTypeOptionCaption",1],[557,"call","GetDocumentTypeOptionString",1],[558,"call","GetDocumentTypeOptionCaption",1],[562,"call","LogErrorMessage",4],[563,"call","ConstructDocumenttypeUnknownErr",0],[566,"ext","table",1214,"InsertOrUpdateEntry",6]]},{"name":"ConstructDocumenttypeUnknownErr","line":593,"kind":"procedure","params":0,"steps":[[603,"call","GetDocumentTypeOptionCaption",1],[604,"call","GetDocumentTypeOptionCaption",1]]},{"name":"FindAppropriateGLAccount","line":610,"kind":"procedure","params":5,"steps":[[621,"ext","table",1214,"GetEntryValue",5],[626,"ext","table",1251,"SearchEnteriesInText",3],[628,"call","FindCorrectAccountFromMapping",3],[630,"call","LogErrorMessage",4],[636,"ext","table",1251,"SearchEnteriesInText",3],[638,"call","FindCorrectAccountFromMapping",3],[640,"call","LogErrorMessage",4],[661,"call","LogErrorMessage",4]]}]}