{"title":"Page 402 Sales Order Statistics, extension points 29","url":"https://jonas-paprotka.de/ref/page/402-sales-order-statistics/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":"page","id":402,"name":"Sales Order Statistics","app":"Base Application","url":"https://jonas-paprotka.de/ref/page/402-sales-order-statistics/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/page/402-sales-order-statistics/source/","path":"src/Layers/W1/BaseApp/Sales/Document/SalesOrderStatistics.Page.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:36":{"name":"Sales Header","url":"https://jonas-paprotka.de/ref/table/36-sales-header/"},"table:290":{"name":"VAT Amount Line","url":"https://jonas-paprotka.de/ref/table/290-vat-amount-line/"},"codeunit:56":{"name":"Sales - Calc Discount By Type","url":"https://jonas-paprotka.de/ref/codeunit/56-sales-calc-discount-by-type/"},"codeunit:414":{"name":"Release Sales Document","url":"https://jonas-paprotka.de/ref/codeunit/414-release-sales-document/"},"table:37":{"name":"Sales Line","url":"https://jonas-paprotka.de/ref/table/37-sales-line/"},"codeunit:80":{"name":"Sales-Post","url":"https://jonas-paprotka.de/ref/codeunit/80-sales-post/"},"codeunit:442":{"name":"Sales-Post Prepayments","url":"https://jonas-paprotka.de/ref/codeunit/442-sales-post-prepayments/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"page:9401":{"name":"VAT Amount Lines","url":"https://jonas-paprotka.de/ref/page/9401-vat-amount-lines/"},"codeunit:27":{"name":"Confirm Management","url":"https://jonas-paprotka.de/ref/codeunit/27-confirm-management/"}},"procs":[{"name":"InvDiscountAmount_General.OnValidate","line":51,"kind":"trigger","steps":[[54,"call","UpdateInvDiscAmount",1]]},{"name":"TotalAmount1[1].OnValidate","line":65,"kind":"trigger","steps":[[68,"call","UpdateTotalAmount",1]]},{"name":"TotalAmount2[1].OnValidate","line":89,"kind":"trigger","steps":[[91,"call","TotalAmount21OnAfterValidate",0]]},{"name":"TotalAdjCostLCY[1] - TotalSalesLineLCY[1]..OnDrillDown","line":228,"kind":"trigger","steps":[[230,"ext","table",36,"LookupAdjmtValueEntries",1]]},{"name":"NoOfVATLines_General.OnDrillDown","line":241,"kind":"trigger","steps":[[243,"call","VATLinesDrillDown",2],[244,"call","UpdateHeaderInfo",2]]},{"name":"InvDiscountAmount_Invoicing.OnValidate","line":276,"kind":"trigger","steps":[[279,"call","UpdateInvDiscAmount",1]]},{"name":"TotalInclVAT_Invoicing.OnValidate","line":290,"kind":"trigger","steps":[[293,"call","UpdateTotalAmount",1]]},{"name":"TotalAdjCostLCY[2] - TotalSalesLineLCY[2]..OnDrillDown","line":446,"kind":"trigger","steps":[[448,"ext","table",36,"LookupAdjmtValueEntries",1]]},{"name":"NoOfVATLines_Invoicing.OnDrillDown","line":459,"kind":"trigger","steps":[[462,"call","VATLinesDrillDown",2],[463,"call","UpdateHeaderInfo",2],[465,"ext","table",290,"GetAnyLineModified",0],[466,"call","UpdateVATOnSalesLines",0],[467,"call","RefreshOnAfterGetRecord",0]]},{"name":"TempVATAmountLine3.COUNT.OnDrillDown","line":629,"kind":"trigger","steps":[[631,"call","VATLinesDrillDown",2]]},{"name":"PrepmtTotalAmount.OnValidate","line":646,"kind":"trigger","steps":[[649,"call","UpdatePrepmtAmount",0]]},{"name":"PrepmtTotalAmount2.OnValidate","line":670,"kind":"trigger","steps":[[672,"event","OnBeforeValidatePrepmtTotalAmount2",0],[673,"call","UpdatePrepmtAmount",0]]},{"name":"TempVATAmountLine4.COUNT.OnDrillDown","line":729,"kind":"trigger","steps":[[731,"call","VATLinesDrillDown",2]]},{"name":"CreditLimitLCYExpendedPct.OnAfterGetRecord","line":779,"kind":"trigger","steps":[[781,"call","RefreshOnAfterGetRecord",0]]},{"name":"OnOpenPage","line":784,"kind":"trigger","steps":[[786,"ext","table",36,"PrepareOpeningDocumentStatistics",0],[788,"call","CustInvDiscRecExists",1],[792,"event","OnOpenPageOnBeforeSetEditable",0]]},{"name":"OnClosePage","line":797,"kind":"trigger","steps":[[801,"ext","codeunit",56,"ResetRecalculateInvoiceDisc",1]]},{"name":"OnQueryClosePage","line":804,"kind":"trigger","steps":[[809,"call","GetVATSpecification",1],[810,"ext","codeunit",414,"CalcAndUpdateVATOnLines",2]]},{"name":"RefreshOnAfterGetRecord","line":870,"kind":"procedure","access":"local","params":0,"steps":[[912,"event","OnRefreshOnAfterGetRecordOnBeforeTempSalesLineDeleteAll",0],[913,"write",37,"DeleteAll"],[916,"ext","codeunit",80,"GetSalesLines",4],[917,"event","OnRefreshOnAfterGetRecordOnAfterGetSalesLines",0],[921,"ext","table",37,"CalcVATAmountLines",4],[923,"ext","table",37,"CalcVATAmountLines",4],[925,"ext","table",37,"CalcVATAmountLines",4],[928,"ext","codeunit",80,"SumSalesLinesTemp",11],[946,"event","OnRefreshOnAfterGetRecordOnAfterSetTotalAmounts",0],[949,"event","OnAfterCalculateTotalAmounts",0],[951,"write",37,"DeleteAll"],[953,"ext","codeunit",442,"GetSalesLines",3],[954,"ext","codeunit",442,"SumPrepmt",6],[957,"call","Pct",2],[959,"call","Pct",2],[971,"event","OnRefreshOnAfterGetRecordOnBeforeSetCreditLimitLCYExpendedPct",0],[984,"write",290,"ModifyAll"],[985,"write",290,"ModifyAll"],[986,"write",290,"ModifyAll"],[987,"write",290,"ModifyAll"],[992,"call","UpdateHeaderInfo",2]]},{"name":"UpdateHeaderInfo","line":1000,"kind":"procedure","params":2,"steps":[[1006,"ext","table",290,"GetTotalInvDiscAmount",0],[1008,"event","OnUpdateHeaderInfoOnAfterSetTotalAmount",0],[1009,"ext","table",290,"GetTotalVATAmount",0],[1011,"ext","table",290,"GetTotalAmountInclVAT",0],[1014,"event","OnUpdateHeaderInfoOnBeforeSetLineAmount",1],[1021,"event","OnUpdateHeaderInfoOnBeforeSetAmount",0],[1033,"ext","table",330,"ExchangeAmtFCYToLCY",4],[1048,"event","OnAfterUpdateHeaderInfo",0]]},{"name":"GetVATSpecification","line":1051,"kind":"procedure","access":"local","params":1,"steps":[[1056,"ext","page",9401,"GetTempVATAmountLine",1],[1057,"call","UpdateHeaderInfo",2],[1061,"ext","page",9401,"GetTempVATAmountLine",1],[1062,"call","UpdateHeaderInfo",2],[1065,"ext","page",9401,"GetTempVATAmountLine",1]]},{"name":"UpdateTotalAmount","line":1069,"kind":"procedure","access":"protected","params":1,"steps":[[1073,"call","CheckAllowInvDisc",0],[1076,"call","UpdateInvDiscAmount",1],[1081,"call","UpdateInvDiscAmount",1]]},{"name":"UpdateInvDiscAmount","line":1084,"kind":"procedure","access":"protected","params":1,"steps":[[1095,"call","CheckAllowInvDisc",0],[1099,"ext","table",36,"InvoicedLineExists",0],[1100,"ext","codeunit",27,"GetResponseOrDefault",2],[1104,"ext","table",290,"GetTotalInvDiscBaseAmount",2],[1106,"ext","table",290,"GetTotalInvDiscBaseAmount",2],[1135,"ext","table",290,"SetInvoiceDiscountAmount",4],[1138,"ext","table",290,"SetInvoiceDiscountAmount",4],[1143,"ext","table",290,"GetTotalInvDiscBaseAmount",2],[1145,"ext","table",290,"SetInvoiceDiscountPercent",5],[1148,"ext","table",290,"SetInvoiceDiscountPercent",5],[1149,"ext","table",290,"GetTotalInvDiscAmount",0],[1152,"ext","table",290,"GetTotalInvDiscBaseAmount",2],[1154,"ext","table",290,"SetInvoiceDiscountPercent",5],[1157,"ext","table",290,"SetInvoiceDiscountPercent",5],[1158,"ext","table",290,"GetTotalInvDiscAmount",0],[1163,"call","UpdateHeaderInfo",2],[1164,"call","UpdateHeaderInfo",2],[1167,"ext","page",9401,"SetTempVATAmountLine",1],[1169,"ext","page",9401,"SetTempVATAmountLine",1],[1173,"write",36,"Modify"],[1175,"call","UpdateVATOnSalesLines",0]]},{"name":"UpdatePrepmtAmount","line":1178,"kind":"procedure","access":"local","params":0,"steps":[[1183,"ext","codeunit",442,"UpdatePrepmtAmountOnSaleslines",2],[1184,"ext","codeunit",442,"GetSalesLines",3],[1185,"ext","codeunit",442,"SumPrepmt",6],[1188,"call","Pct",2],[1190,"call","Pct",2],[1196,"write",36,"Modify"]]},{"name":"UpdateVATOnSalesLines","line":1206,"kind":"procedure","access":"local","params":0,"steps":[[1210,"call","GetVATSpecification",1],[1211,"ext","table",290,"GetAnyLineModified",0],[1212,"ext","table",37,"UpdateVATOnLines",4],[1213,"ext","table",290,"GetAnyLineModified",0],[1214,"ext","table",37,"UpdateVATOnLines",4]]},{"name":"CheckAllowInvDisc","line":1226,"kind":"procedure","access":"local","params":0,"steps":[[1231,"event","OnAfterCheckAllowInvDisc",0]]},{"name":"VATLinesDrillDown","line":1241,"kind":"procedure","access":"protected","params":2,"steps":[[1244,"ext","page",9401,"SetTempVATAmountLine",1],[1245,"ext","page",9401,"InitGlobals",6],[1249,"ext","page",9401,"GetTempVATAmountLine",1]]},{"name":"TotalAmount21OnAfterValidate","line":1252,"kind":"procedure","access":"local","params":0,"steps":[[1258,"call","UpdateInvDiscAmount",1]]}]}