{"title":"Codeunit 7009 CopyFromToPriceListLine, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/7009-copyfromtopricelistline/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":7009,"name":"CopyFromToPriceListLine","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/7009-copyfromtopricelistline/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/7009-copyfromtopricelistline/source/","path":"src/Layers/W1/BaseApp/Pricing/PriceList/CopyFromToPriceListLine.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":{"table:7001":{"name":"Price List Line","url":"https://jonas-paprotka.de/ref/table/7001-price-list-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/"},"table:202":{"name":"Resource Cost","url":"https://jonas-paprotka.de/ref/table/202-resource-cost/"},"codeunit:220":{"name":"Resource-Find Cost","url":"https://jonas-paprotka.de/ref/codeunit/220-resource-find-cost/"},"codeunit:7017":{"name":"Price List Management","url":"https://jonas-paprotka.de/ref/codeunit/7017-price-list-management/"},"table:7000":{"name":"Price List Header","url":"https://jonas-paprotka.de/ref/table/7000-price-list-header/"},"codeunit:8703":{"name":"Feature Telemetry","url":"https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/"},"codeunit:7001":{"name":"Price Calculation Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/7001-price-calculation-mgt/"}},"procs":[{"name":"CopyFrom","line":53,"kind":"procedure","params":2,"steps":[[60,"write",7001,"DeleteAll"],[66,"validate",7001,"Source Type"],[66,"call","ConvertToSourceType",1],[67,"validate",7001,"Source No."],[72,"validate",7001,"Asset Type"],[73,"validate",7001,"Asset No."],[75,"call","VerifySalesPriceConsistency",1],[76,"validate",7001,"Variant Code"],[77,"validate",7001,"Unit of Measure Code"],[87,"event","OnCopyFromSalesPrice",0],[88,"call","InsertPriceListLine",1]]},{"name":"VerifySalesPriceConsistency","line":95,"kind":"procedure","access":"local","params":1,"steps":[[100,"call","ReferencedItemRecordMissing",1],[103,"call","ReferencedItemVariantRecordMissing",2],[106,"call","ReferencedUnitOfMeasureRecordMissing",2],[109,"call","ReferencedCurrencyRecordMissing",1]]},{"name":"CopyFrom","line":306,"kind":"procedure","params":2,"steps":[[313,"write",7001,"DeleteAll"],[319,"validate",7001,"Source Type"],[319,"call","ConvertToSourceType",1],[320,"validate",7001,"Source No."],[326,"validate",7001,"Asset Type"],[328,"validate",7001,"Asset Type"],[330,"validate",7001,"Asset No."],[332,"call","VerifySalesLineDiscConsistency",1],[334,"validate",7001,"Variant Code"],[335,"validate",7001,"Unit of Measure Code"],[345,"event","OnCopyFromSalesLineDiscount",0],[346,"call","InsertPriceListLine",1]]},{"name":"VerifySalesLineDiscConsistency","line":353,"kind":"procedure","access":"local","params":1,"steps":[[359,"call","ReferencedItemRecordMissing",1],[362,"call","ReferencedItemVariantRecordMissing",2],[365,"call","ReferencedUnitOfMeasureRecordMissing",2],[369,"call","ReferencedCurrencyRecordMissing",1]]},{"name":"CopyTo","line":403,"kind":"procedure","params":2,"steps":[[406,"write",7002,"DeleteAll"],[410,"call","ConvertFromSourceType",2],[424,"event","OnCopyToSalesPrice",0],[425,"write",7002,"Insert",1]]},{"name":"CopyTo","line":444,"kind":"procedure","params":2,"steps":[[447,"write",7004,"DeleteAll"],[451,"call","ConvertFromSourceType",2],[455,"call","ConvertAssetTypeToSalesDiscType",1],[464,"event","OnCopyToSalesLineDiscount",0],[465,"write",7004,"Insert",1]]},{"name":"CopyFrom","line":496,"kind":"procedure","params":2,"steps":[[503,"write",7001,"DeleteAll"],[510,"call","SetJobAsSource",3],[511,"validate",7001,"Asset Type"],[512,"validate",7001,"Asset No."],[514,"call","VerifyJobItemPriceConsistency",1],[515,"validate",7001,"Variant Code"],[516,"validate",7001,"Unit of Measure Code"],[525,"call","InsertPriceListLine",1],[531,"validate",7001,"Amount Type"],[536,"call","InsertPriceListLine",1],[538,"event","OnCopyFromJobItemPrice",0]]},{"name":"VerifyJobItemPriceConsistency","line":545,"kind":"procedure","access":"local","params":1,"steps":[[550,"call","ReferencedItemRecordMissing",1],[553,"call","ReferencedItemVariantRecordMissing",2],[556,"call","ReferencedUnitOfMeasureRecordMissing",2],[559,"call","ReferencedCurrencyRecordMissing",1]]},{"name":"CopyFrom","line":565,"kind":"procedure","params":2,"steps":[[572,"write",7001,"DeleteAll"],[578,"call","SetJobAsSource",3],[579,"validate",7001,"Asset Type"],[580,"validate",7001,"Asset No."],[582,"call","VerifyJobGLAccountPriceConsistency",1],[604,"event","OnCopyFromJobGLAccountPrice",0],[605,"call","InsertPriceListLine",1],[617,"event","OnCopyFromJobGLAccountPrice",0],[618,"call","InsertPriceListLine",1]]},{"name":"VerifyJobGLAccountPriceConsistency","line":626,"kind":"procedure","access":"local","params":1,"steps":[[631,"call","ReferencedGLAccountRecordMissing",1],[634,"call","ReferencedCurrencyRecordMissing",1]]},{"name":"CopyFrom","line":640,"kind":"procedure","params":2,"steps":[[647,"write",7001,"DeleteAll"],[654,"call","SetJobAsSource",3],[658,"validate",7001,"Asset Type"],[660,"validate",7001,"Asset Type"],[662,"validate",7001,"Asset No."],[664,"call","VerifyJobResourcePriceConsistency",1],[674,"call","InsertPriceListLine",1],[680,"validate",7001,"Amount Type"],[685,"call","InsertPriceListLine",1],[687,"event","OnCopyFromJobResourcePrice",0]]},{"name":"VerifyJobResourcePriceConsistency","line":694,"kind":"procedure","access":"local","params":1,"steps":[[700,"call","ReferencedResourceRecordMissing",1],[704,"call","ReferencedCurrencyRecordMissing",1],[707,"call","ReferencedWorkTypeRecordMissing",1]]},{"name":"SetJobAsSource","line":713,"kind":"procedure","access":"local","params":3,"steps":[[716,"call","ReferencedJobRecordMissing",1],[720,"call","ReferencedJobTaskRecordMissing",2],[724,"validate",7001,"Source Type"],[725,"validate",7001,"Source No."],[727,"validate",7001,"Source Type"],[728,"validate",7001,"Parent Source No."],[729,"validate",7001,"Source No."]]},{"name":"CopyFrom","line":734,"kind":"procedure","params":2,"steps":[[742,"write",7001,"DeleteAll"],[750,"validate",7001,"Source Type"],[755,"validate",7001,"Asset Type"],[757,"validate",7001,"Asset Type"],[759,"validate",7001,"Asset No."],[761,"call","VerifyResourceCostConsistency",1],[768,"event","OnCopyFromResourceCost",0],[769,"call","InsertPriceListLine",1],[771,"write",202,"Insert"],[775,"call","CopySpecialCostTypes",2]]},{"name":"VerifyResourceCostConsistency","line":780,"kind":"procedure","access":"local","params":1,"steps":[[786,"call","ReferencedResourceRecordMissing",1],[790,"call","ReferencedWorkTypeRecordMissing",1]]},{"name":"CopySpecialCostTypes","line":796,"kind":"procedure","access":"local","params":2,"steps":[[804,"call","FindResources",2],[805,"call","CreatePriceLinePerResource",4]]},{"name":"CreatePriceLinePerResource","line":822,"kind":"procedure","access":"local","params":4,"steps":[[828,"call","IsDuplicateResourceCost",3],[832,"run","codeunit",220],[834,"write",202,"Insert"],[838,"validate",7001,"Source Type"],[840,"validate",7001,"Asset Type"],[841,"validate",7001,"Asset No."],[843,"call","VerifyResourceCostConsistency",1],[850,"event","OnCopyFromResourceCost",0],[851,"call","InsertPriceListLine",1]]},{"name":"CopyFrom","line":865,"kind":"procedure","params":2,"steps":[[872,"write",7001,"DeleteAll"],[878,"validate",7001,"Source Type"],[882,"validate",7001,"Asset Type"],[884,"validate",7001,"Asset Type"],[886,"validate",7001,"Asset No."],[888,"call","VerifyResourcePriceConsistency",1],[897,"event","OnCopyFromResourcePrice",0],[898,"call","InsertPriceListLine",1]]},{"name":"VerifyResourcePriceConsistency","line":904,"kind":"procedure","access":"local","params":1,"steps":[[910,"call","ReferencedResourceRecordMissing",1],[914,"call","ReferencedCurrencyRecordMissing",1],[917,"call","ReferencedWorkTypeRecordMissing",1]]},{"name":"CopyFrom","line":923,"kind":"procedure","params":2,"steps":[[930,"write",7001,"DeleteAll"],[936,"validate",7001,"Source Type"],[937,"validate",7001,"Source No."],[941,"validate",7001,"Asset Type"],[942,"validate",7001,"Asset No."],[944,"call","VerifyPurchPriceConsistency",1],[945,"validate",7001,"Variant Code"],[946,"validate",7001,"Unit of Measure Code"],[955,"event","OnCopyFromPurchasePrice",0],[956,"call","InsertPriceListLine",1]]},{"name":"VerifyPurchPriceConsistency","line":963,"kind":"procedure","access":"local","params":1,"steps":[[968,"call","ReferencedItemRecordMissing",1],[971,"call","ReferencedItemVariantRecordMissing",2],[974,"call","ReferencedUnitOfMeasureRecordMissing",2],[977,"call","ReferencedCurrencyRecordMissing",1]]},{"name":"CopyFrom","line":983,"kind":"procedure","params":2,"steps":[[990,"write",7001,"DeleteAll"],[996,"validate",7001,"Source Type"],[997,"validate",7001,"Source No."],[1001,"validate",7001,"Asset Type"],[1002,"validate",7001,"Asset No."],[1004,"call","VerifyPurchLineDiscConsistency",1],[1005,"validate",7001,"Variant Code"],[1006,"validate",7001,"Unit of Measure Code"],[1015,"event","OnCopyFromPurchLineDiscount",0],[1016,"call","InsertPriceListLine",1]]},{"name":"VerifyPurchLineDiscConsistency","line":1023,"kind":"procedure","access":"local","params":1,"steps":[[1028,"call","ReferencedItemRecordMissing",1],[1031,"call","ReferencedItemVariantRecordMissing",2],[1034,"call","ReferencedUnitOfMeasureRecordMissing",2],[1037,"call","ReferencedCurrencyRecordMissing",1]]},{"name":"InsertPriceListLine","line":1043,"kind":"procedure","access":"local","params":1,"steps":[[1045,"call","InitLineNo",1],[1046,"event","OnBeforeInsertPriceListLine",0],[1047,"write",7001,"Insert",1]]},{"name":"InitLineNo","line":1050,"kind":"procedure","params":1,"steps":[[1057,"call","SetPriceListCode",1],[1058,"ext","table",7001,"SetNextLineNo",0],[1059,"call","GetMaxPriceLineNo",0],[1061,"ext","codeunit",7017,"DefineDefaultPriceList",2],[1062,"ext","table",7001,"SetNextLineNo",0],[1065,"event","OnAfterInitLineNo",0]]},{"name":"SetPriceListCode","line":1073,"kind":"procedure","access":"local","params":1,"steps":[[1081,"ext","codeunit",7017,"GetDefaultPriceListCode",3],[1084,"call","FindHeader",2],[1085,"call","InsertHeader",2],[1092,"write",7000,"Modify"]]},{"name":"FindHeader","line":1097,"kind":"procedure","access":"local","params":2,"steps":[[1107,"event","OnBeforeFindHeader",0]]},{"name":"InsertHeader","line":1111,"kind":"procedure","access":"local","params":2,"steps":[[1117,"ext","codeunit",8703,"LogUptake",3],[1117,"ext","codeunit",7001,"GetFeatureTelemetryName",0],[1119,"ext","table",7001,"CopyTo",1],[1120,"ext","table",7000,"CopyFrom",1],[1121,"call","GenerateDescription",1],[1124,"event","OnBeforeInsertHeader",0],[1125,"write",7000,"Insert",1],[1127,"ext","codeunit",8703,"LogUsage",3],[1127,"ext","codeunit",7001,"GetFeatureTelemetryName",0]]}]}