{"title":"Codeunit 225 Gen. Jnl.-Apply, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/225-gen-jnl-apply/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":225,"name":"Gen. Jnl.-Apply","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/225-gen-jnl-apply/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/225-gen-jnl-apply/source/","path":"src/Layers/W1/BaseApp/Finance/ReceivablesPayables/GenJnlApply.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":{"page:232":{"name":"Apply Customer Entries","url":"https://jonas-paprotka.de/ref/page/232-apply-customer-entries/"},"page:233":{"name":"Apply Vendor Entries","url":"https://jonas-paprotka.de/ref/page/233-apply-vendor-entries/"},"page:234":{"name":"Apply Employee Entries","url":"https://jonas-paprotka.de/ref/page/234-apply-employee-entries/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"table:4":{"name":"Currency","url":"https://jonas-paprotka.de/ref/table/4-currency/"},"codeunit:426":{"name":"Payment Tolerance Management","url":"https://jonas-paprotka.de/ref/codeunit/426-payment-tolerance-management/"},"table:21":{"name":"Cust. Ledger Entry","url":"https://jonas-paprotka.de/ref/table/21-cust-ledger-entry/"},"table:81":{"name":"Gen. Journal Line","url":"https://jonas-paprotka.de/ref/table/81-gen-journal-line/"},"codeunit:225":{"name":"Gen. Jnl.-Apply","url":"https://jonas-paprotka.de/ref/codeunit/225-gen-jnl-apply/"},"codeunit:111":{"name":"Vend. Entry-SetAppl.ID","url":"https://jonas-paprotka.de/ref/codeunit/111-vend-entry-setappl-id/"},"table:25":{"name":"Vendor Ledger Entry","url":"https://jonas-paprotka.de/ref/table/25-vendor-ledger-entry/"},"codeunit:27":{"name":"Confirm Management","url":"https://jonas-paprotka.de/ref/codeunit/27-confirm-management/"}},"procs":[{"name":"OnRun","line":32,"kind":"trigger","steps":[[39,"event","OnBeforeRun",1],[43,"call","GetCurrency",0],[55,"call","ApplyCustomerLedgerEntry",1],[57,"call","ApplyVendorLedgerEntry",1],[59,"call","ApplyEmployeeLedgerEntry",1],[65,"event","OnAfterRun",0]]},{"name":"SelectCustLedgEntry","line":97,"kind":"procedure","access":"local","params":2,"steps":[[105,"event","OnBeforeSelectCustLedgEntry",1],[112,"event","OnSelectCustLedgEntryOnAfterSetFilters",0],[120,"ext","page",232,"SetGenJnlLine",2],[127,"ext","page",232,"GetCustomAppliesToID",0],[130,"event","OnAfterSelectCustLedgEntry",0]]},{"name":"SelectVendLedgEntry","line":133,"kind":"procedure","access":"local","params":2,"steps":[[140,"event","OnBeforeSelectVendLedgEntry",1],[147,"event","OnSelectVendLedgEntryOnAfterSetFilters",0],[154,"ext","page",233,"SetGenJnlLine",2],[159,"ext","page",233,"GetCustomAppliesToID",0],[162,"event","OnAfterSelectVendLedgEntry",0]]},{"name":"SelectEmplLedgEntry","line":165,"kind":"procedure","access":"local","params":2,"steps":[[172,"event","OnBeforeSelectEmplLedgEntry",1],[179,"event","OnSelectEmplLedgEntryOnAfterSetFilters",0],[186,"ext","page",234,"SetGenJnlLine",2],[191,"ext","page",234,"GetCustomAppliesToID",0],[194,"event","OnAfterSelectEmplLedgEntry",0]]},{"name":"UpdateCustLedgEntry","line":197,"kind":"procedure","access":"local","params":1,"steps":[[202,"event","OnBeforeUpdateCustLedgEntry",1],[208,"ext","table",330,"ExchangeAmount",4],[213,"ext","table",330,"ExchangeAmount",4],[218,"ext","table",330,"ExchangeAmount",4]]},{"name":"UpdateVendLedgEntry","line":224,"kind":"procedure","access":"local","params":1,"steps":[[229,"event","OnBeforeUpdateVendLedgEntry",1],[235,"ext","table",330,"ExchangeAmount",4],[240,"ext","table",330,"ExchangeAmount",4],[245,"ext","table",330,"ExchangeAmount",4],[250,"event","OnAfterUpdateVendLedgEntry",0]]},{"name":"UpdateEmployeeLedgEntry","line":253,"kind":"procedure","access":"local","params":1,"steps":[[258,"ext","table",330,"ExchangeAmount",4],[265,"ext","table",330,"ExchangeAmount",4]]},{"name":"CheckAgainstApplnCurrency","line":281,"kind":"procedure","params":4,"steps":[[289,"event","OnBeforeCheckAgainstApplnCurrency",0]]},{"name":"GetCurrency","line":351,"kind":"procedure","access":"local","params":0,"steps":[[354,"ext","table",4,"InitRoundingPrecision",0]]},{"name":"ApplyCustomerLedgerEntry","line":361,"kind":"procedure","access":"local","params":1,"steps":[[369,"call","GetAppliedCustomerEntries",2],[370,"call","SelectCustLedgEntry",2],[381,"event","OnAfterCustLedgEntrySetFilters",1],[390,"ext","codeunit",426,"DelPmtTolApllnDocNo",2],[391,"event","OnApplyCustomerLedgerEntryOnBeforeCheckAgainstApplnCurrency",0],[392,"call","CheckAgainstApplnCurrency",4],[393,"call","UpdateCustLedgEntry",1],[395,"event","OnBeforeFindCustApply",1],[397,"ext","codeunit",426,"CheckCalcPmtDiscGenJnlCust",4],[399,"ext","table",21,"GetRemainingPmtDiscPossible",1],[401,"ext","table",21,"GetRemainingPmtDiscPossible",1],[405,"call","GetAppliedAmountOnCustLedgerEntry",2],[407,"write",21,"DeleteAll"],[414,"validate",81,"Amount"],[415,"event","OnApplyCustomerLedgerEntryOnAfterValidateAmount",0],[418,"event","OnApplyCustomerLedgerEntryOnBeforeCheckAgainstApplnCurrencyCustomerAmountNotZero",0],[419,"call","CheckAgainstApplnCurrency",4],[424,"event","OnApplyCustomerLedgerEntryOnBeforeConfirmUpdateCurrency",1],[426,"call","ConfirmCurrencyUpdate",2],[430,"event","OnApplyCustomerLedgerEntryOnBeforeCheckAgainstApplnCurrencyCustomer",0],[431,"call","CheckAgainstApplnCurrency",4],[435,"event","OnApplyCustomerLedgerEntryOnAfterSetCustomerAppliesToDocNo",0],[442,"ext","table",81,"SetJournalLineFieldsFromApplication",0],[444,"event","OnApplyCustomerLedgerEntryOnBeforeModify",0],[446,"write",81,"Modify"],[448,"ext","codeunit",426,"PmtTolGenJnl",1]]},{"name":"SetVendApplIdAPI","line":458,"kind":"procedure","params":2,"steps":[[488,"event","OnSetVendApplIdAPIOnBeforeCheckPostingDate",0],[495,"event","OnSetVendApplIdAPIOnBeforeCheckAgainstApplnCurrency",0],[496,"ext","codeunit",225,"CheckAgainstApplnCurrency",4],[502,"ext","codeunit",111,"SetApplId",3]]},{"name":"ApplyVendorLedgerEntryAPI","line":510,"kind":"procedure","params":1,"steps":[[516,"call","GetCurrency",0],[517,"ext","table",81,"GetAccTypeAndNo",3],[519,"call","GetAppliedVendorEntries",2],[532,"ext","codeunit",426,"DelPmtTolApllnDocNo",2],[533,"event","OnApplyVendorLedgerEntryAPIOnBeforeCheckAgainstApplnCurrencyAmountZero",0],[534,"call","CheckAgainstApplnCurrency",4],[535,"call","UpdateVendLedgEntry",1],[536,"ext","codeunit",426,"CheckCalcPmtDiscGenJnlVend",4],[538,"ext","table",25,"GetRemainingPmtDiscPossible",1],[545,"write",25,"DeleteAll"],[548,"event","OnApplyVendorLedgerEntryAPIOnBeforeValidateAmount",0],[549,"validate",81,"Amount"],[552,"event","OnApplyVendorLedgerEntryAPIOnBeforeCheckAgainstApplnCurrencyAmountNonZero",0],[553,"call","CheckAgainstApplnCurrency",4],[559,"event","OnApplyVendorLedgerEntryAPIOnBeforeCheckAgainstApplnCurrencyDifferentCurrenciesAmountNonZero",0],[560,"call","CheckAgainstApplnCurrency",4],[564,"event","OnApplyVendorLedgerEntryOnAfterSetVendorAppliesToDocNo",0],[568,"ext","table",81,"SetJournalLineFieldsFromApplication",0],[570,"write",81,"Modify"],[572,"ext","codeunit",426,"PmtTolGenJnl",1]]},{"name":"ApplyVendorLedgerEntry","line":576,"kind":"procedure","access":"local","params":1,"steps":[[583,"call","GetAppliedVendorEntries",2],[584,"call","SelectVendLedgEntry",2],[593,"event","OnAfterVendLedgEntrySetFilters",0],[599,"ext","codeunit",426,"DelPmtTolApllnDocNo",2],[600,"event","OnApplyVendorLedgerEntryOnBeforeCheckAgainstApplnCurrency",0],[601,"call","CheckAgainstApplnCurrency",4],[602,"call","UpdateVendLedgEntry",1],[604,"event","OnBeforeFindVendApply",1],[606,"ext","codeunit",426,"CheckCalcPmtDiscGenJnlVend",4],[608,"ext","table",25,"GetRemainingPmtDiscPossible",1],[610,"ext","table",25,"GetRemainingPmtDiscPossible",1],[616,"write",25,"DeleteAll"],[619,"event","OnApplyVendorLedgerEntryOnBeforeValidateAmount",0],[620,"validate",81,"Amount"],[623,"event","OnApplyVendorLedgerEntryOnBeforeCheckAgainstApplnCurrencyAmountNotZero",0],[624,"call","CheckAgainstApplnCurrency",4],[629,"event","OnApplyVendorLedgerEntryOnBeforeConfirmUpdateCurrency",1],[631,"call","ConfirmCurrencyUpdate",2],[635,"event","OnApplyVendorLedgerEntryOnBeforeCheckAgainstApplnCurrencyDifferentCurrenciesAmountNotZero",0],[636,"call","CheckAgainstApplnCurrency",4],[640,"event","OnApplyVendorLedgerEntryOnAfterSetGenJnlLineAppliesToDocNo",0],[647,"ext","table",81,"SetJournalLineFieldsFromApplication",0],[649,"event","OnApplyVendorLedgerEntryOnBeforeModify",0],[650,"write",81,"Modify"],[652,"ext","codeunit",426,"PmtTolGenJnl",1]]},{"name":"ApplyEmployeeLedgerEntry","line":656,"kind":"procedure","access":"local","params":1,"steps":[[661,"call","SelectEmplLedgEntry",2],[674,"call","UpdateEmployeeLedgEntry",1],[675,"event","OnApplyEmployeeLedgerEntryOnBeforeUpdateAmount",0],[683,"validate",81,"Amount"],[687,"call","ConfirmCurrencyUpdate",2],[698,"ext","table",81,"SetJournalLineFieldsFromApplication",0],[700,"write",81,"Modify"],[702,"event","OnAfterApplyEmployeeLedgerEntry",0]]},{"name":"GetAppliedCustomerEntries","line":705,"kind":"procedure","access":"local","params":2,"steps":[[724,"write",21,"Insert"]]},{"name":"GetAppliedVendorEntries","line":729,"kind":"procedure","access":"local","params":2,"steps":[[748,"write",25,"Insert"]]},{"name":"ConfirmCurrencyUpdate","line":753,"kind":"procedure","access":"local","params":2,"steps":[[757,"ext","codeunit",27,"GetResponseOrDefault",2]]},{"name":"GetAppliedAmountOnCustLedgerEntry","line":765,"kind":"procedure","access":"local","params":2,"steps":[[774,"call","CalcAppliedAmountOnCustLedgerEntry",2],[776,"call","CalcAppliedAmountOnCustLedgerEntry",2]]},{"name":"CalcAppliedAmountOnCustLedgerEntry","line":779,"kind":"procedure","access":"local","params":2,"steps":[[782,"event","OnCalcAppliedAmountOnCustLedgerEntryOnAfterCalcRemainingAmount",0],[783,"ext","codeunit",426,"CheckCalcPmtDiscGenJnlCust",4]]}]}