{"title":"Codeunit 227 VendEntry-Apply Posted Entries, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/227-vendentry-apply-posted-entries/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":227,"name":"VendEntry-Apply Posted Entries","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/227-vendentry-apply-posted-entries/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/227-vendentry-apply-posted-entries/source/","path":"src/Layers/W1/BaseApp/Purchases/Payables/VendEntryApplyPostedEntries.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:9500":{"name":"Sequence No. Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/9500-sequence-no-mgt/"},"table:98":{"name":"General Ledger Setup","url":"https://jonas-paprotka.de/ref/table/98-general-ledger-setup/"},"codeunit:426":{"name":"Payment Tolerance Management","url":"https://jonas-paprotka.de/ref/codeunit/426-payment-tolerance-management/"},"table:81":{"name":"Gen. Journal Line","url":"https://jonas-paprotka.de/ref/table/81-gen-journal-line/"},"codeunit:12":{"name":"Gen. Jnl.-Post Line","url":"https://jonas-paprotka.de/ref/codeunit/12-gen-jnl-post-line/"},"codeunit:19":{"name":"Gen. Jnl.-Post Preview","url":"https://jonas-paprotka.de/ref/codeunit/19-gen-jnl-post-preview/"},"codeunit:410":{"name":"Update Analysis View","url":"https://jonas-paprotka.de/ref/codeunit/410-update-analysis-view/"},"table:380":{"name":"Detailed Vendor Ledg. Entry","url":"https://jonas-paprotka.de/ref/table/380-detailed-vendor-ledg-entry/"},"page:624":{"name":"Unapply Vendor Entries","url":"https://jonas-paprotka.de/ref/page/624-unapply-vendor-entries/"},"table:87":{"name":"Date Compr. Register","url":"https://jonas-paprotka.de/ref/table/87-date-compr-register/"},"codeunit:599":{"name":"Exch. Rate Adjmt. Run Handler","url":"https://jonas-paprotka.de/ref/codeunit/599-exch-rate-adjmt-run-handler/"},"codeunit:11":{"name":"Gen. Jnl.-Check Line","url":"https://jonas-paprotka.de/ref/codeunit/11-gen-jnl-check-line/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"codeunit:113":{"name":"Vend. Entry-Edit","url":"https://jonas-paprotka.de/ref/codeunit/113-vend-entry-edit/"},"page:233":{"name":"Apply Vendor Entries","url":"https://jonas-paprotka.de/ref/page/233-apply-vendor-entries/"},"table:25":{"name":"Vendor Ledger Entry","url":"https://jonas-paprotka.de/ref/table/25-vendor-ledger-entry/"},"codeunit:227":{"name":"VendEntry-Apply Posted Entries","url":"https://jonas-paprotka.de/ref/codeunit/227-vendentry-apply-posted-entries/"}},"procs":[{"name":"OnRun","line":25,"kind":"trigger","steps":[[30,"ext","codeunit",9500,"SetPreviewMode",1],[34,"call","Apply",2],[36,"call","PostUnApplyVendor",2],[40,"ext","table",98,"GetRecordOnce",0],[50,"call","Apply",2]]},{"name":"Apply","line":82,"kind":"procedure","params":2,"steps":[[87,"event","OnBeforeApply",0],[90,"event","OnApplyOnBeforePmtTolVend",1],[93,"ext","codeunit",426,"PmtTolVend",1],[99,"call","GetApplicationDate",1],[101,"call","GetApplicationDate",1],[103,"event","OnApplyOnBeforePostingDateMustNotBeBeforeError",1],[111,"event","OnApplyOnBeforeVendPostApplyVendLedgEntry",0],[112,"call","VendPostApplyVendLedgEntry",2]]},{"name":"GetApplicationDate","line":116,"kind":"procedure","params":1,"steps":[[122,"event","OnBeforeGetApplicationDate",1],[130,"event","OnGetApplicationDateOnAfterSetFilters",0]]},{"name":"VendPostApplyVendLedgEntry","line":138,"kind":"procedure","access":"local","params":2,"steps":[[152,"event","OnBeforeVendPostApplyVendLedgEntry",1],[172,"ext","table",81,"CopyVendLedgEntry",1],[179,"call","FindLastApplDtldVendLedgEntry",0],[181,"event","OnBeforePostApplyVendLedgEntry",0],[182,"ext","codeunit",12,"VendPostApplyVendLedgEntry",2],[183,"event","OnAfterPostApplyVendLedgEntry",0],[185,"call","FindLastApplDtldVendLedgEntry",0],[190,"ext","codeunit",19,"ThrowError",0],[193,"event","OnVendPostApplyVendLedgEntryOnBeforeCommit",0],[198,"call","RunUpdateAnalysisView",0]]},{"name":"RunUpdateAnalysisView","line":201,"kind":"procedure","access":"local","params":0,"steps":[[207,"event","OnBeforeRunUpdateAnalysisView",1],[211,"ext","codeunit",410,"UpdateAll",2]]},{"name":"FindLastApplDtldVendLedgEntry","line":214,"kind":"procedure","access":"local","params":0,"steps":[[219,"ext","table",380,"GetLastEntryNo",0]]},{"name":"FindLastApplEntry","line":222,"kind":"procedure","params":1,"steps":[[231,"event","OnFindLastApplEntryOnAfterSetFilters",0]]},{"name":"UnApplyDtldVendLedgEntry","line":261,"kind":"procedure","params":1,"steps":[[267,"call","FindLastApplEntry",1],[271,"call","CheckReversal",1],[272,"call","UnApplyVendor",1]]},{"name":"UnApplyVendLedgEntry","line":275,"kind":"procedure","params":1,"steps":[[279,"call","CheckVendorLedgerEntryToUnapply",2],[280,"call","UnApplyVendor",1]]},{"name":"CheckVendorLedgerEntryToUnapply","line":283,"kind":"procedure","params":2,"steps":[[287,"call","CheckReversal",1],[288,"call","FindLastApplEntry",1]]},{"name":"UnApplyVendor","line":294,"kind":"procedure","access":"local","params":1,"steps":[[300,"event","OnBeforeUnApplyVendor",1],[304,"ext","page",624,"SetDtldVendLedgEntry",1],[309,"event","OnAfterUnApplyVendor",0]]},{"name":"PostUnApplyVendor","line":312,"kind":"procedure","params":2,"steps":[[314,"call","PostUnApplyVendorCommit",3]]},{"name":"PostUnApplyVendorCommit","line":317,"kind":"procedure","params":3,"steps":[[335,"event","OnBeforePostUnApplyVendorCommit",1],[346,"event","OnPostUnApplyVendorOnAfterGetVendLedgEntry",0],[348,"call","CheckPostingDate",2],[351,"event","OnPostUnApplyVendorCommitOnBeforePostingDateMustNotBeBeforeError",1],[356,"event","OnPostUnApplyVendorCommitOnBeforeFilterDtldVendLedgEntry",0],[367,"event","OnPostUnApplyVendorOnAfterDtldVendLedgEntrySetFilters",0],[371,"call","CheckAdditionalCurrency",2],[374,"call","CheckReversal",1],[376,"call","CheckUnappliedEntries",1],[379,"ext","table",87,"CheckMaxDateCompressed",2],[381,"ext","table",98,"GetRecordOnce",0],[390,"ext","table",81,"CopyVendLedgEntry",1],[401,"event","OnBeforePostUnapplyVendLedgEntry",0],[402,"call","CollectAffectedLedgerEntries",2],[403,"ext","codeunit",12,"UnapplyVendLedgEntry",2],[404,"call","RunVendExchRateAdjustment",2],[405,"event","OnAfterPostUnapplyVendLedgEntry",0],[409,"ext","codeunit",19,"ThrowError",0]]},{"name":"RunVendExchRateAdjustment","line":417,"kind":"procedure","access":"local","params":2,"steps":[[423,"event","OnBeforeRunVendExchRateAdjustment",1],[427,"ext","codeunit",599,"RunVendExchRateAdjustment",2]]},{"name":"CheckPostingDate","line":430,"kind":"procedure","access":"local","params":2,"steps":[[434,"ext","codeunit",11,"SetGenJnlBatch",1],[435,"ext","codeunit",11,"DateNotAllowed",1]]},{"name":"CheckAdditionalCurrency","line":442,"kind":"procedure","access":"local","params":2,"steps":[[448,"ext","table",98,"GetRecordOnce",0],[450,"ext","table",330,"ExchangeRate",2],[451,"ext","table",330,"ExchangeRate",2]]},{"name":"CheckReversal","line":456,"kind":"procedure","params":1,"steps":[[463,"event","OnAfterCheckReversal",0]]},{"name":"ApplyVendEntryFormEntry","line":466,"kind":"procedure","params":1,"steps":[[473,"event","OnBeforeApplyVendEntryFormEntry",1],[480,"event","OnApplyVendEntryFormEntryOnAfterCheckEntryOpen",0],[492,"event","OnApplyVendEntryFormEntryOnBeforeRunVendEntryEdit",0],[493,"run","codeunit",113],[499,"call","RunApplyVendEntries",3]]},{"name":"RunApplyVendEntries","line":502,"kind":"procedure","access":"local","params":3,"steps":[[508,"event","OnApplyVendEntryFormEntryOnAfterVendLedgEntrySetFilters",1],[513,"ext","page",233,"SetVendLedgEntry",1],[517,"ext","page",233,"SetAppliesToID",1]]},{"name":"CollectAffectedLedgerEntries","line":526,"kind":"procedure","access":"local","params":2,"steps":[[530,"write",25,"DeleteAll"],[542,"event","OnCollectAffectedLedgerEntriesOnAfterSetFilters",0],[546,"write",25,"Insert"]]},{"name":"PreviewApply","line":567,"kind":"procedure","params":2,"steps":[[573,"ext","codeunit",426,"PmtTolVend",1],[577,"ext","codeunit",227,"SetApplyContext",1],[578,"ext","codeunit",19,"Preview",2]]},{"name":"PreviewUnapply","line":581,"kind":"procedure","params":2,"steps":[[588,"ext","codeunit",227,"SetUnapplyContext",2],[589,"ext","codeunit",19,"Preview",2]]},{"name":"GetAppliedVendLedgerEntries","line":605,"kind":"procedure","params":2,"steps":[[632,"write",25,"Insert"],[638,"write",25,"Insert"]]},{"name":"CheckUnappliedEntries","line":643,"kind":"procedure","access":"local","params":1,"steps":[[649,"call","FindLastApplTransactionEntry",1],[651,"event","OnCheckUnappliedEntriesOnBeforeUnapplyAllEntriesError",1],[656,"call","FindLastTransactionNo",1]]},{"name":"OnRunPreview","line":662,"kind":"procedure","access":"local","params":3,"steps":[[668,"run","codeunit",227]]}]}