{"title":"Codeunit 5701 Item Subst., extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5701-item-subst/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":5701,"name":"Item Subst.","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5701-item-subst/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5701-item-subst/source/","path":"src/Layers/W1/BaseApp/Inventory/Item/Substitution/ItemSubst.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:5718":{"name":"Item Substitution Entries","url":"https://jonas-paprotka.de/ref/page/5718-item-substitution-entries/"},"codeunit:5703":{"name":"Catalog Item Management","url":"https://jonas-paprotka.de/ref/codeunit/5703-catalog-item-management/"},"codeunit:311":{"name":"Item-Check Avail.","url":"https://jonas-paprotka.de/ref/codeunit/311-item-check-avail/"},"codeunit:99000832":{"name":"Sales Line-Reserve","url":"https://jonas-paprotka.de/ref/codeunit/99000832-sales-line-reserve/"},"table:37":{"name":"Sales Line","url":"https://jonas-paprotka.de/ref/table/37-sales-line/"},"table:5715":{"name":"Item Substitution","url":"https://jonas-paprotka.de/ref/table/5715-item-substitution/"},"codeunit:5790":{"name":"Available to Promise","url":"https://jonas-paprotka.de/ref/codeunit/5790-available-to-promise/"},"table:901":{"name":"Assembly Line","url":"https://jonas-paprotka.de/ref/table/901-assembly-line/"},"codeunit:926":{"name":"Assembly Line-Reserve","url":"https://jonas-paprotka.de/ref/codeunit/926-assembly-line-reserve/"}},"procs":[{"name":"ItemSubstGet","line":51,"kind":"procedure","params":1,"steps":[[73,"call","SaveItemSalesUOM",1],[80,"event","OnItemSubstGetOnAfterItemSubstitutionSetFilters",0],[82,"call","CalcCustPrice",3],[88,"event","OnItemSubstGetOnAfterTempItemSubstitutionSetFilters",1],[90,"run","page",5718],[94,"ext","codeunit",5703,"CreateItemFromNonstock",1],[99,"call","ItemSubstGetPopulateTempSalesLine",2],[102,"ext","codeunit",311,"SalesLineCheck",1],[110,"ext","codeunit",99000832,"DeleteLine",1],[113,"event","OnAfterItemSubstGet",0]]},{"name":"ItemSubstGetPopulateTempSalesLine","line":116,"kind":"procedure","access":"local","params":2,"steps":[[121,"event","OnBeforeItemSubstGetPopulateTempSalesLine",1],[131,"validate",37,"No."],[132,"validate",37,"Variant Code"],[137,"validate",37,"Quantity"],[138,"validate",37,"Unit of Measure Code"],[140,"ext","table",37,"CreateDimFromDefaultDim",1],[142,"event","OnItemSubstGetOnAfterSubstSalesLineItem",0]]},{"name":"CalcCustPrice","line":145,"kind":"procedure","params":3,"steps":[[150,"event","OnBeforeCalcCustPrice",1],[155,"write",5715,"DeleteAll"],[171,"call","GetSetupData",0],[172,"event","OnCalcCustPriceOnBeforeCalcQtyAvail",0],[174,"ext","codeunit",5790,"CalcQtyAvailabletoPromise",6],[179,"event","OnCalcCustPriceOnAfterCalcQtyAvail",0],[186,"event","OnCalcCustPriceOnBeforeTempItemSubstitutionInsert",0],[187,"write",5715,"Insert"]]},{"name":"AssemblyCalcCustPrice","line":191,"kind":"procedure","access":"local","params":2,"steps":[[196,"write",5715,"DeleteAll"],[212,"call","GetSetupData",0],[213,"event","OnAssemblyCalcCustPriceOnBeforeCalcQtyAvail",0],[215,"ext","codeunit",5790,"CalcQtyAvailabletoPromise",6],[220,"event","OnAssemblyCalcCustPriceOnAfterCalcQtyAvail",0],[227,"write",5715,"Insert"]]},{"name":"FindItemSubstitutions","line":238,"kind":"procedure","params":8,"steps":[[251,"write",5715,"DeleteAll"],[252,"call","CreateSubstList",8]]},{"name":"CreateSubstList","line":259,"kind":"procedure","access":"local","params":8,"steps":[[286,"event","OnCreateSubstListOnBeforeCalcQuantityAvailable",0],[288,"ext","codeunit",5790,"CalcQtyAvailabletoPromise",6],[292,"event","OnCreateSubstListOnAfterCalcQuantityAvailable",0],[296,"call","IsSubstitutionInserted",2],[309,"write",5715,"Modify"]]},{"name":"ItemAssemblySubstGet","line":323,"kind":"procedure","params":1,"steps":[[342,"call","SaveItemSalesUOM",1],[350,"call","AssemblyCalcCustPrice",2],[356,"run","page",5718],[362,"validate",901,"No."],[363,"validate",901,"Variant Code"],[365,"validate",901,"Quantity"],[366,"validate",901,"Unit of Measure Code"],[368,"ext","codeunit",311,"AssemblyLineCheck",1],[375,"ext","codeunit",926,"DeleteLine",1]]},{"name":"IsSubstitutionInserted","line":380,"kind":"procedure","access":"local","params":2,"steps":[[388,"write",5715,"Insert"]]},{"name":"SaveItemSalesUOM","line":393,"kind":"procedure","access":"local","params":1,"steps":[[398,"event","OnBeforeSaveItemSalesUOM",1]]}]}