{"title":"Codeunit 108 Net Cust/Vend Balances Mgt., extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/108-net-cust-vend-balances-mgt/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":108,"name":"Net Cust/Vend Balances Mgt.","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/108-net-cust-vend-balances-mgt/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/108-net-cust-vend-balances-mgt/source/","path":"src/Layers/W1/BaseApp/Finance/ReceivablesPayables/NetCustVendBalancesMgt.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:109":{"name":"Net Balances Parameters","url":"https://jonas-paprotka.de/ref/table/109-net-balances-parameters/"},"table:23":{"name":"Vendor","url":"https://jonas-paprotka.de/ref/table/23-vendor/"},"table:81":{"name":"Gen. Journal Line","url":"https://jonas-paprotka.de/ref/table/81-gen-journal-line/"},"codeunit:103":{"name":"Cust. Entry-Edit","url":"https://jonas-paprotka.de/ref/codeunit/103-cust-entry-edit/"},"codeunit:113":{"name":"Vend. Entry-Edit","url":"https://jonas-paprotka.de/ref/codeunit/113-vend-entry-edit/"}},"procs":[{"name":"NetCustVendBalances","line":48,"kind":"procedure","params":2,"steps":[[54,"ext","table",109,"Verify",0],[55,"call","Initialize",0],[66,"call","FindLinkedCustomer",2],[67,"call","HandleVendor",2]]},{"name":"FindLinkedCustomer","line":73,"kind":"procedure","access":"local","params":2,"steps":[[77,"ext","table",23,"GetLinkedCustomer",0]]},{"name":"Initialize","line":89,"kind":"procedure","access":"local","params":0,"steps":[[98,"validate",81,"Journal Template Name"],[99,"validate",81,"Journal Batch Name"],[100,"call","SetGenJnlLine",1]]},{"name":"HandleVendor","line":111,"kind":"procedure","access":"local","params":2,"steps":[[119,"call","FindVendLedgEntries",2],[123,"call","NetCustVendBalances",3],[126,"call","NetCustVendBalances",3]]},{"name":"SetNetAmount","line":136,"kind":"procedure","access":"local","params":3,"steps":[[142,"call","SumVendorRemainingAmount",2],[144,"call","SumCustomerRemainingAmount",2],[146,"call","MinDec",2]]},{"name":"NetCustVendBalances","line":150,"kind":"procedure","access":"local","params":3,"steps":[[162,"call","SetNetAmount",3],[173,"call","CalcPartNetAmount",5],[175,"call","CalcPartNetAmount",5],[192,"call","MinDec",2],[193,"call","NetBalances",5],[197,"call","MinDec",2],[198,"call","NetBalances",5],[200,"call","MinDec",2],[203,"call","NetBalances",5],[208,"call","MinDec",2],[209,"call","NetBalances",5],[211,"call","MinDec",2],[214,"call","NetBalances",5],[222,"call","NetBalances",5],[224,"call","MinDec",2],[227,"call","NetBalances",5],[229,"call","MinDec",2],[232,"call","NetBalances",5],[239,"call","NetBalances",5],[241,"call","MinDec",2],[244,"call","NetBalances",5],[246,"call","MinDec",2],[249,"call","NetBalances",5],[255,"call","NetBalances",5],[256,"call","MinDec",2],[258,"call","NetBalances",5]]},{"name":"InsertGenJnlLine","line":265,"kind":"procedure","access":"local","params":4,"steps":[[267,"call","InitGenJnlLine",2],[269,"call","FillGenJnlLineFromVendLedgEntry",2],[271,"call","FillGenJnlLineFromCustledgEntry",2],[272,"call","FailIfDuplicateLineExists",1],[273,"write",81,"Insert"]]},{"name":"NetBalances","line":291,"kind":"procedure","access":"local","params":5,"steps":[[302,"call","SetOnHold",1],[304,"event","OnNetBalancesBeforeSetVendorRemainingAmount",0],[306,"call","InsertGenJnlLine",4],[310,"call","SetOnHold",1],[312,"event","OnNetBalancesBeforeSetCustomerRemainingAmount",0],[316,"call","MinDec",2],[325,"call","InsertGenJnlLine",4],[335,"validate",81,"Amount"],[336,"write",81,"Modify"],[339,"call","InsertGenJnlLine",4],[340,"validate",81,"Amount"],[341,"write",81,"Modify"]]},{"name":"CalcPartNetAmount","line":357,"kind":"procedure","access":"local","params":5,"steps":[[365,"event","OnCalcPartNetAmountAfterSetDocumentType",1]]},{"name":"FillGenJnlLineFromVendLedgEntry","line":384,"kind":"procedure","access":"local","params":2,"steps":[[388,"validate",81,"Account No."],[394,"validate",81,"Bal. Account No."],[395,"validate",81,"Currency Code"],[397,"event","OnFillGenJnlLineFromVendLedgEntryBeforeValidateAmount",0],[398,"validate",81,"Amount"],[404,"event","OnAfterFillGenJnlLineFromVendLedgEntry",0]]},{"name":"FillGenJnlLineFromCustledgEntry","line":407,"kind":"procedure","access":"local","params":2,"steps":[[411,"validate",81,"Account No."],[417,"validate",81,"Bal. Account No."],[418,"validate",81,"Currency Code"],[420,"event","OnFillGenJnlLineFromCustledgEntryBeforeValidateAmount",0],[421,"validate",81,"Amount"],[427,"event","OnAfterFillGenJnlLineFromCustLedgEntry",0]]},{"name":"InitGenJnlLine","line":430,"kind":"procedure","access":"local","params":2,"steps":[[435,"validate",81,"Posting Date"],[450,"event","OnAfterInitGenJnlLine",0]]},{"name":"SetOnHold","line":453,"kind":"procedure","access":"local","params":1,"steps":[[457,"ext","codeunit",103,"SetOnHold",2]]},{"name":"SetOnHold","line":460,"kind":"procedure","access":"local","params":1,"steps":[[464,"ext","codeunit",113,"SetOnHold",2]]},{"name":"SumCustomerRemainingAmount","line":474,"kind":"procedure","access":"local","params":2,"steps":[[487,"event","OnSumCustomerRemainingAmountBeforeCalcResult",1]]},{"name":"SumVendorRemainingAmount","line":498,"kind":"procedure","access":"local","params":2,"steps":[[511,"event","OnSumVendorRemainingAmountBeforeCalcResult",1]]}]}