{"title":"Codeunit 7021 Purchase Line - Price, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/7021-purchase-line-price/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":7021,"name":"Purchase Line - Price","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/7021-purchase-line-price/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/7021-purchase-line-price/source/","path":"src/Layers/W1/BaseApp/Purchases/Pricing/PurchaseLinePrice.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:7011":{"name":"Price Source List","url":"https://jonas-paprotka.de/ref/codeunit/7011-price-source-list/"},"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"},"codeunit:7008":{"name":"Price Calculation Buffer Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/7008-price-calculation-buffer-mgt/"},"table:7007":{"name":"Price Calculation Buffer","url":"https://jonas-paprotka.de/ref/table/7007-price-calculation-buffer/"},"table:7001":{"name":"Price List Line","url":"https://jonas-paprotka.de/ref/table/7001-price-list-line/"}},"procs":[{"name":"SetLine","line":33,"kind":"procedure","params":2,"steps":[[40,"call","AddSources",0]]},{"name":"SetSources","line":50,"kind":"procedure","params":1,"steps":[[52,"ext","codeunit",7011,"Copy",1]]},{"name":"SetPurchaseQtyInvoice","line":55,"kind":"procedure","params":1,"steps":[[60,"validate",39,"Qty. to Invoice"],[60,"ext","table",39,"MaxQtyToInvoice",0],[61,"write",39,"Modify",1]]},{"name":"SetPurchaseReceiveQty","line":64,"kind":"procedure","params":1,"steps":[[69,"validate",39,"Qty. to Receive"],[70,"write",39,"Modify",1]]},{"name":"IsPriceUpdateNeeded","line":89,"kind":"procedure","params":3,"steps":[[102,"event","OnAfterIsPriceUpdateNeeded",0]]},{"name":"IsDiscountAllowed","line":105,"kind":"procedure","params":0,"steps":[[108,"event","OnAfterIsDiscountAllowed",0]]},{"name":"Verify","line":111,"kind":"procedure","params":0,"steps":[[116,"event","OnBeforeVerify",1],[120,"ext","table",39,"IsProdOrder",0]]},{"name":"SetAssetSourceForSetup","line":127,"kind":"procedure","params":1,"steps":[[132,"call","GetAssetType",0],[134,"ext","codeunit",7011,"GetSourceGroup",1]]},{"name":"SetAssetSource","line":137,"kind":"procedure","access":"local","params":1,"steps":[[140,"call","GetAssetType",0]]},{"name":"GetAssetType","line":145,"kind":"procedure","params":0,"steps":[[157,"event","OnAfterGetAssetType",0]]},{"name":"CopyToBuffer","line":160,"kind":"procedure","params":1,"steps":[[164,"event","OnBeforeCopyToBuffer",0],[167,"call","SetAssetSource",1],[170,"call","FillBuffer",1],[171,"ext","codeunit",7008,"Set",2]]},{"name":"FillBuffer","line":175,"kind":"procedure","access":"local","params":1,"steps":[[183,"ext","table",39,"GetVATPct",0],[211,"call","GetDocumentDate",0],[214,"validate",7007,"Currency Code"],[223,"call","IsDiscountAllowed",0],[225,"event","OnAfterFillBuffer",0]]},{"name":"AddSources","line":228,"kind":"procedure","access":"local","params":0,"steps":[[230,"ext","codeunit",7011,"Init",0],[231,"call","AddVendorSources",0],[232,"ext","codeunit",7011,"AddJobAsSources",2],[233,"event","OnAfterAddSources",0]]},{"name":"AddVendorSources","line":236,"kind":"procedure","access":"local","params":0,"steps":[[238,"ext","codeunit",7011,"Add",1],[239,"ext","codeunit",7011,"Add",2],[240,"ext","codeunit",7011,"Add",2],[241,"ext","codeunit",7011,"Add",2]]},{"name":"GetDocumentDate","line":244,"kind":"procedure","access":"local","params":0,"steps":[[246,"ext","table",39,"GetDateForCalculations",1],[247,"event","OnAfterGetDocumentDate",0]]},{"name":"SetPrice","line":250,"kind":"procedure","params":2,"steps":[[255,"event","OnBeforeSetPrice",1],[266,"ext","table",7001,"IsRealLine",0],[275,"event","OnAfterSetPrice",0]]},{"name":"ValidatePrice","line":278,"kind":"procedure","params":1,"steps":[[281,"validate",39,"Line Discount %"],[283,"validate",39,"Direct Unit Cost"],[285,"event","OnAfterValidatePrice",0]]},{"name":"Update","line":288,"kind":"procedure","params":1,"steps":[[293,"event","OnAfterUpdate",0]]}]}