{"title":"Codeunit 6087 Serv. Price Calc. Mgt., extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/6087-serv-price-calc-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":6087,"name":"Serv. Price Calc. Mgt.","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/6087-serv-price-calc-mgt/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/6087-serv-price-calc-mgt/source/","path":"src/Layers/W1/BaseApp/Service/Pricing/ServPriceCalcMgt.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:7000":{"name":"Sales Price Calc. Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/7000-sales-price-calc-mgt/"},"codeunit:221":{"name":"Resource-Find Price","url":"https://jonas-paprotka.de/ref/codeunit/221-resource-find-price/"},"table:5902":{"name":"Service Line","url":"https://jonas-paprotka.de/ref/table/5902-service-line/"},"table:7002":{"name":"Sales Price","url":"https://jonas-paprotka.de/ref/table/7002-sales-price/"},"table:7004":{"name":"Sales Line Discount","url":"https://jonas-paprotka.de/ref/table/7004-sales-line-discount/"},"codeunit:220":{"name":"Resource-Find Cost","url":"https://jonas-paprotka.de/ref/codeunit/220-resource-find-cost/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"page:7007":{"name":"Get Sales Price","url":"https://jonas-paprotka.de/ref/page/7007-get-sales-price/"},"page:7009":{"name":"Get Sales Line Disc.","url":"https://jonas-paprotka.de/ref/page/7009-get-sales-line-disc/"},"table:207":{"name":"Res. Journal Line","url":"https://jonas-paprotka.de/ref/table/207-res-journal-line/"}},"procs":[{"name":"FindServLinePrice","line":61,"kind":"procedure","params":3,"steps":[[68,"event","OnBeforeFindServLinePrice",1],[70,"ext","codeunit",7000,"RunOnBeforeFindServLinePrice",4],[77,"call","SetCurrency",3],[78,"call","ServHeaderExchDate",1],[79,"call","SetVAT",4],[80,"call","SetUoM",2],[81,"call","SetLineDisc",3],[91,"call","ServLinePriceExists",3],[92,"call","CalcBestUnitPrice",1],[106,"call","SetResPrice",3],[107,"run","codeunit",221],[109,"event","OnAfterFindServLineResPrice",1],[111,"ext","codeunit",7000,"RunOnAfterFindServLineResPrice",5],[115,"call","ConvertPriceToVAT",4],[117,"call","ConvertPriceLCYToFCY",2],[140,"call","ConvertPriceToVAT",4],[141,"call","ConvertPriceLCYToFCY",2],[145,"event","OnAfterFindServLinePrice",0],[147,"ext","codeunit",7000,"RunOnAfterFindServLinePrice",6]]},{"name":"FindServLineDisc","line":151,"kind":"procedure","params":2,"steps":[[156,"event","OnBeforeFindServLineDisc",1],[158,"ext","codeunit",7000,"RunOnBeforeFindServLineDisc",3],[163,"call","SetCurrency",3],[164,"call","SetUoM",2],[170,"call","FindSalesLineDisc",12],[174,"call","CalcBestLineDisc",1],[181,"ext","table",5902,"CalcChargeableQty",0],[186,"event","OnAfterFindServLineDisc",0],[188,"ext","codeunit",7000,"RunOnAfterFindServLineDisc",3]]},{"name":"CalcBestUnitPrice","line":192,"kind":"procedure","params":1,"steps":[[198,"event","OnBeforeCalcBestUnitPrice",1],[200,"ext","codeunit",7000,"RunOnBeforeCalcBestUnitPrice",2],[209,"event","OnCalcBestUnitPriceOnBeforeCalcBestUnitPriceConvertPrice",1],[211,"ext","codeunit",7000,"RunOnCalcBestUnitPriceOnBeforeCalcBestUnitPriceConvertPrice",4],[214,"call","IsInMinQty",2],[215,"call","CalcBestUnitPriceConvertPrice",1],[227,"call","CalcLineAmount",1],[227,"call","CalcLineAmount",1],[236,"event","OnAfterCalcBestUnitPrice",0],[238,"ext","codeunit",7000,"RunOnAfterCalcBestUnitPrice",2],[243,"call","ConvertPriceToVAT",4],[246,"call","ConvertPriceToUoM",2],[247,"call","ConvertPriceLCYToFCY",2],[253,"event","OnAfterCalcBestUnitPriceAsItemUnitPrice",0],[255,"ext","codeunit",7000,"RunOnAfterCalcBestUnitPriceAsItemUnitPrice",2]]},{"name":"CalcBestUnitPriceConvertPrice","line":262,"kind":"procedure","access":"local","params":1,"steps":[[267,"event","OnBeforeCalcBestUnitPriceConvertPrice",1],[269,"ext","codeunit",7000,"RunOnBeforeCalcBestUnitPriceConvertPrice",3],[274,"call","ConvertPriceToVAT",4],[277,"call","ConvertPriceToUoM",2],[278,"call","ConvertPriceLCYToFCY",2]]},{"name":"CalcBestLineDisc","line":281,"kind":"procedure","params":1,"steps":[[287,"event","OnBeforeCalcBestLineDisc",1],[289,"ext","codeunit",7000,"RunOnBeforeCalcBestLineDisc",5],[296,"call","IsInMinQty",2]]},{"name":"FindSalesPrice","line":311,"kind":"procedure","params":11,"steps":[[320,"write",7002,"DeleteAll"],[322,"event","OnBeforeFindSalesPrice",0],[326,"ext","codeunit",7000,"RunOnBeforeFindSalesPrice",14],[343,"call","CopySalesPriceToSalesPrice",2],[348,"call","CopySalesPriceToSalesPrice",2],[354,"call","CopySalesPriceToSalesPrice",2],[359,"ext","codeunit",7000,"ActivatedCampaignExists",4],[362,"call","CopySalesPriceToSalesPrice",2],[366,"event","OnAfterFindSalesPrice",0],[370,"ext","codeunit",7000,"RunOnAfterFindSalesPrice",14]]},{"name":"FindSalesLineDisc","line":376,"kind":"procedure","params":12,"steps":[[382,"event","OnBeforeFindSalesLineDisc",0],[386,"ext","codeunit",7000,"RunOnBeforeFindSalesLineDisc",12],[393,"event","OnFindSalesLineDiscOnAfterSetFilters",0],[395,"ext","codeunit",7000,"RunOnFindSalesLineDiscOnAfterSetFilters",1],[405,"write",7004,"DeleteAll"],[425,"ext","codeunit",7000,"ActivatedCampaignExists",4],[433,"call","CopySalesDiscToSalesDisc",2],[438,"call","CopySalesDiscToSalesDisc",2],[441,"event","OnFindSalesLineDiscOnAfterCopyItemDiscGroup",0],[450,"event","OnAfterFindSalesLineDisc",0],[454,"ext","codeunit",7000,"RunOnAfterFindSalesLineDisc",12]]},{"name":"FindResUnitCost","line":460,"kind":"procedure","params":1,"steps":[[467,"run","codeunit",220],[468,"ext","table",5902,"AfterResourseFindCost",1],[469,"validate",5902,"Unit Cost (LCY)"]]},{"name":"CopySalesPrice","line":472,"kind":"procedure","params":1,"steps":[[474,"write",7002,"DeleteAll"],[475,"call","CopySalesPriceToSalesPrice",2]]},{"name":"CopySalesPriceToSalesPrice","line":478,"kind":"procedure","access":"local","params":2,"steps":[[483,"event","OnBeforeCopySalesPriceToSalesPrice",1],[485,"ext","codeunit",7000,"RunOnBeforeCopySalesPriceToSalesPrice",3],[493,"write",7002,"Insert"]]},{"name":"CopySalesDiscToSalesDisc","line":497,"kind":"procedure","access":"local","params":2,"steps":[[502,"event","OnBeforeCopySalesDiscToSalesDisc",1],[509,"write",7004,"Insert"]]},{"name":"SetResPrice","line":518,"kind":"procedure","params":3,"steps":[[521,"event","OnSetResPriceOnAfterInit",0],[523,"ext","codeunit",7000,"RunOnSetResPriceOnAfterInit",1]]},{"name":"ConvertPriceToVAT","line":570,"kind":"procedure","params":4,"steps":[[578,"event","OnBeforeConvertPriceToVAT",1],[580,"ext","codeunit",7000,"RunOnBeforeConvertPriceToVAT",3]]},{"name":"ConvertPriceLCYToFCY","line":618,"kind":"procedure","params":2,"steps":[[625,"ext","table",330,"ExchangeAmtLCYToFCY",4]]},{"name":"CalcLineAmount","line":631,"kind":"procedure","access":"local","params":1,"steps":[[637,"event","OnAfterCalcLineAmount",0],[639,"ext","codeunit",7000,"RunOnAfterCalcLineAmount",3]]},{"name":"GetServLinePrice","line":643,"kind":"procedure","params":2,"steps":[[648,"event","OnBeforeGetServLinePrice",1],[650,"ext","codeunit",7000,"RunOnBeforeGetServLinePrice",3],[655,"call","ServLinePriceExists",3],[657,"run","page",7007],[658,"call","SetVAT",4],[660,"call","SetUoM",2],[661,"call","SetCurrency",3],[662,"call","ServHeaderExchDate",1],[664,"call","IsInMinQty",2],[682,"call","ServHeaderStartDate",2],[689,"call","ConvertPriceToVAT",4],[692,"call","ConvertPriceToUoM",2],[693,"call","ConvertPriceLCYToFCY",2],[700,"validate",5902,"Unit Price"],[701,"ext","table",5902,"ConfirmAdjPriceLineChange",0]]},{"name":"GetServLineLineDisc","line":705,"kind":"procedure","params":2,"steps":[[710,"event","OnBeforeGetServLineDisc",1],[712,"ext","codeunit",7000,"RunOnBeforeGetServLineDisc",3],[717,"call","ServLineLineDiscExists",3],[719,"run","page",7009],[720,"call","SetCurrency",3],[721,"call","SetUoM",2],[723,"call","IsInMinQty",2],[741,"call","ServHeaderStartDate",2],[749,"ext","table",5902,"CheckLineDiscount",1],[750,"validate",5902,"Line Discount %"],[751,"ext","table",5902,"ConfirmAdjPriceLineChange",0]]},{"name":"ServLinePriceExists","line":756,"kind":"procedure","params":3,"steps":[[762,"event","OnBeforeServLinePriceExists",1],[764,"ext","codeunit",7000,"RunOnBeforeServLinePriceExists",5],[767,"call","FindSalesPrice",11],[770,"call","ServHeaderStartDate",2],[771,"event","OnAfterServLinePriceExists",0],[773,"ext","codeunit",7000,"RunOnAfterServLinePriceExists",1]]},{"name":"ServLineLineDiscExists","line":781,"kind":"procedure","params":3,"steps":[[787,"event","OnBeforeServLineLineDiscExists",1],[789,"ext","codeunit",7000,"RunOnBeforeServLineLineDiscExists",5],[792,"call","FindSalesLineDisc",12],[795,"call","ServHeaderStartDate",2],[796,"event","OnAfterServLineLineDiscExists",0],[798,"ext","codeunit",7000,"RunOnAfterServLineLineDiscExists",1]]},{"name":"NoOfServLinePrice","line":825,"kind":"procedure","params":3,"steps":[[830,"event","OnBeforeNoOfServLinePrice",1],[832,"ext","codeunit",7000,"RunOnBeforeNoOfServLinePrice",5],[837,"call","ServLinePriceExists",3]]},{"name":"NoOfServLineLineDisc","line":841,"kind":"procedure","params":3,"steps":[[846,"event","OnBeforeNoOfServLineLineDisc",1],[848,"ext","codeunit",7000,"RunOnBeforeNoOfServLineLineDisc",5],[853,"call","ServLineLineDiscExists",3]]},{"name":"FindResPrice","line":857,"kind":"procedure","params":1,"steps":[[863,"ext","table",207,"BeforeFindResPrice",1],[864,"run","codeunit",221],[865,"ext","table",207,"AfterFindResPrice",1],[868,"validate",207,"Unit Price"]]}]}