{"title":"Codeunit 20508 Subc. Price Management, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/20508-subc-price-management/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-24","object":{"type":"codeunit","id":20508,"name":"Subc. Price Management","app":"Subcontracting","url":"https://jonas-paprotka.de/ref/codeunit/20508-subc-price-management/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/20508-subc-price-management/source/","path":"src/Apps/W1/Subcontracting/App/src/Purchase/SubcPriceManagement.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:20569":{"name":"Subc. Feature Flag Handler","url":"https://jonas-paprotka.de/ref/codeunit/20569-subc-feature-flag-handler/"},"table:99000830":{"name":"Planning Routing Line","url":"https://jonas-paprotka.de/ref/table/99000830-planning-routing-line/"},"codeunit:20500":{"name":"Subc. Session State","url":"https://jonas-paprotka.de/ref/codeunit/20500-subc-session-state/"},"codeunit:99000758":{"name":"Mfg. Cost Calculation Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/99000758-mfg-cost-calculation-mgt/"},"codeunit:5402":{"name":"Unit of Measure Management","url":"https://jonas-paprotka.de/ref/codeunit/5402-unit-of-measure-management/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"table:246":{"name":"Requisition Line","url":"https://jonas-paprotka.de/ref/table/246-requisition-line/"},"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"}},"procs":[{"name":"ApplySubcontractorPricingToProdOrderRouting","line":32,"kind":"procedure","params":3,"steps":[[39,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[54,"call","SetSubcontractorPriceForPriceCalculation",8],[64,"call","SetRoutingPriceListCost"]]},{"name":"ApplySubcontractorPricingToPlanningRouting","line":77,"kind":"procedure","params":3,"steps":[[84,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[99,"call","SetSubcontractorPriceForPriceCalculation",8],[109,"call","SetRoutingPriceListCost"],[121,"validate",99000830,"Direct Unit Cost"],[123,"ext","table",99000830,"UpdateDatetime",0]]},{"name":"CalcStandardCostOnAfterCalcRtngLineCost","line":126,"kind":"procedure","params":3,"steps":[[137,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[154,"ext","codeunit",20500,"GetRecordID",2],[158,"ext","codeunit",20500,"GetRecordID",2],[165,"ext","codeunit",20500,"GetDate",0],[171,"ext","codeunit",20500,"ClearAllDictionariesForKey",0],[172,"ext","codeunit",20500,"ClearAllDictionariesForKey",0]]},{"name":"CalcStandardCostOnAfterCalcRtngLineCost","line":175,"kind":"procedure","access":"internal","params":5,"steps":[[186,"call","CalcRtngCostPerUnit",9],[192,"ext","codeunit",99000758,"CalculateCostTime",12]]},{"name":"CalcRtngCostPerUnit","line":203,"kind":"procedure","access":"local","params":9,"steps":[[210,"call","SetSubcontractorPriceForPriceCalculation",8],[220,"call","SetRoutingPriceListCost"]]},{"name":"GetSubcPriceList","line":233,"kind":"procedure","params":1,"steps":[[242,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[258,"call","GetLine",2],[260,"call","SetSubcontractorPriceForPriceCalculation",8],[270,"call","SetRoutingPriceListCost"]]},{"name":"SetRoutingPriceListCost","line":292,"kind":"procedure","params":10,"steps":[[304,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[343,"call","GetUOMPrice",6],[345,"call","GetPriceByUOM",3],[347,"call","ConvertPriceToUOM",6],[349,"call","ConvertPriceFromCurrency",3]]},{"name":"GetUOMPrice","line":358,"kind":"procedure","access":"local","params":6,"steps":[[365,"ext","codeunit",5402,"GetQtyPerUnitOfMeasure",2]]},{"name":"ConvertPriceToUOM","line":389,"kind":"procedure","params":6,"steps":[[393,"ext","codeunit",20569,"IsSubcontractingEnabled",0]]},{"name":"ConvertPriceToCurrency","line":404,"kind":"procedure","access":"local","params":3,"steps":[[426,"ext","table",330,"ExchangeAmtLCYToFCY",4],[428,"ext","table",330,"ExchangeRate",2],[430,"ext","table",330,"ExchangeAmtFCYToLCY",4],[432,"ext","table",330,"ExchangeRate",2],[434,"ext","table",330,"ExchangeAmtFCYToFCY",4]]},{"name":"ConvertPriceFromCurrency","line":441,"kind":"procedure","access":"local","params":3,"steps":[[447,"ext","table",330,"ExchangeAmtFCYToLCY",4],[449,"ext","table",330,"ExchangeRate",2]]},{"name":"GetSubcPriceForReqLine","line":452,"kind":"procedure","params":2,"steps":[[466,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[491,"ext","table",246,"GetQuantityForUOM",0],[495,"call","GetUOMPrice",6],[495,"ext","table",246,"GetQuantityBase",0],[499,"call","GetProdOrderRtngLine",5],[501,"call","GetOperationCostFactor",2],[504,"call","GetPriceByUOM",3],[513,"call","ConvertPriceToUOM",6],[513,"ext","table",246,"GetQuantityForUOM",0],[514,"call","ConvertPriceToCurrency",3],[525,"ext","table",246,"GetQuantityBase",0]]},{"name":"GetAutomaticSubcCostForReqLine","line":531,"kind":"procedure","access":"internal","params":2,"steps":[[533,"call","GetProdOrderRtngLine",5],[537,"call","GetNonPriceListDirectCost",1],[538,"call","GetSubcPriceForReqLine",2]]},{"name":"IsAutomaticSubcCostForReqLine","line":544,"kind":"procedure","access":"internal","params":2,"steps":[[548,"call","GetAutomaticSubcCostForReqLine",2],[552,"call","GetNonPriceListDirectCost",1]]},{"name":"GetSubcPriceForPurchLine","line":555,"kind":"procedure","params":1,"steps":[[563,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[571,"call","TryGetSubcPriceListCostForPurchLine",4],[573,"call","GetNonPriceListDirectCost",1],[577,"validate",39,"Line Discount %"]]},{"name":"TryGetSubcPriceListCostForPurchLine","line":580,"kind":"procedure","access":"local","params":4,"steps":[[590,"ext","codeunit",20569,"IsSubcontractingEnabled",0],[598,"call","GetProdOrderRtngLine",5],[617,"call","GetUOMPrice",6],[617,"call","GetQuantityBase",1],[618,"call","GetOperationCostFactor",2],[619,"call","GetPriceByUOM",3],[625,"call","ConvertPriceToUOM",6],[625,"ext","table",39,"GetQuantityPerUOM",0],[626,"call","ConvertPriceToCurrency",3]]},{"name":"GetOperationCostFactor","line":630,"kind":"procedure","access":"local","params":2,"steps":[[636,"call","GetTimeBasedOperationCostFactor",1]]},{"name":"GetTimeBasedOperationCostFactor","line":639,"kind":"procedure","access":"local","params":1,"steps":[[648,"call","GetLine",2],[652,"ext","codeunit",99000758,"CalcQtyAdjdForBOMScrap",2],[660,"ext","codeunit",99000758,"CalculateCostTime",12]]},{"name":"GetNonPriceListDirectCost","line":671,"kind":"procedure","access":"local","params":1,"steps":[[676,"call","GetLine",2]]}]}