Describe the issue
Describe the issue
Codeunit 7500 "Item Attribute Management" exposes the public procedure UpdateItemVariantAttributeFromItem(ItemCode: Code[20]). This procedure loops over all variants of an item and calls the local overload UpdateItemVariantAttributeFromItem(ItemVariant, TempItemAttributeValue, ItemCode) to apply the item's attributes to each variant.
There is no integration event inside this loop, and the pre-variant overload is 'local'. As a result, an extension has no supported way to exclude individual variants from the update. The only workaround is to fully duplicate the standard attribute logic in a custom codeunit.
Expected behavior
Expected behavior
An extension should be able to skip the attribute update for a specific variant during the loop, without re-implementing the standard logic. A single 'OnBefore..' integration event with an 'IsHandled' parameter inside the loop would be sufficient.
Proposed event (add at the end of Codeunit 7500):
[IntegrationEvent(false, false)]
local procedure OnUpdateItemVariantAttributeFromItemOnBeforeLoopIteration(ItemVariant: Record "Item Variant"; var IsHandled: Boolean)
begin
end;
Raised inside the existing loop of UpdateItemVariantAttributeFromItem(ItemCode):
if ItemVariant.FindSet() then
repeat
IsHandled := false;
OnUpdateItemVariantAttributeFromItemOnBeforeLoopIteration(ItemVariant, IsHandled);
if not IsHandled then
UpdateItemVariantAttributeFromItem(ItemVariant, TempItemAttributeValue, ItemCode);
until ItemVariant.Next() = 0;
Steps to reproduce
Steps to reproduce
- In an extension, create a table extension on "Item Variant" that distinguishes
"leaf" variants from "intermediate/parent" variants (e.g. a boolean flowfield).
- Try to make
UpdateItemVariantAttributeFromItem(ItemCode) apply attributes to
leaf variants only.
- Observe that there is no event to hook into the per-variant loop, and that the
per-variant overload is local and cannot be called or subscribed to.
- The only remaining option is to copy the entire standard logic into a custom
codeunit — which is exactly what we had to do.
Additional context
Additional context
We model item variants as a hierarchy in which only end-level (leaf) variants may
carry attributes, while intermediate variants must stay attribute-free. Because the
processing loop offers no extension point, we currently maintain a full copy of the
standard attribute logic solely to add this one filtering step. This duplicated code
must be re-validated with every Base Application update.
The requested event is minimal, backward-compatible, and follows the existing
OnBefore…OnBeforeLoopIteration + IsHandled pattern already used elsewhere in
this codeunit (e.g. OnBeforeInsertCategoryItemsAttributeValueMapping). It would
allow us to delete our duplicated implementation and rely on the standard logic.
I will provide a fix for a bug
Describe the issue
Describe the issue
Codeunit 7500 "Item Attribute Management" exposes the public procedure
UpdateItemVariantAttributeFromItem(ItemCode: Code[20]). This procedure loops over all variants of an item and calls the local overloadUpdateItemVariantAttributeFromItem(ItemVariant, TempItemAttributeValue, ItemCode)to apply the item's attributes to each variant.There is no integration event inside this loop, and the pre-variant overload is 'local'. As a result, an extension has no supported way to exclude individual variants from the update. The only workaround is to fully duplicate the standard attribute logic in a custom codeunit.
Expected behavior
Expected behavior
An extension should be able to skip the attribute update for a specific variant during the loop, without re-implementing the standard logic. A single 'OnBefore..' integration event with an 'IsHandled' parameter inside the loop would be sufficient.
Proposed event (add at the end of Codeunit 7500):
Raised inside the existing loop of
UpdateItemVariantAttributeFromItem(ItemCode):Steps to reproduce
Steps to reproduce
"leaf" variants from "intermediate/parent" variants (e.g. a boolean flowfield).
UpdateItemVariantAttributeFromItem(ItemCode)apply attributes toleaf variants only.
per-variant overload is
localand cannot be called or subscribed to.codeunit — which is exactly what we had to do.
Additional context
Additional context
We model item variants as a hierarchy in which only end-level (leaf) variants may
carry attributes, while intermediate variants must stay attribute-free. Because the
processing loop offers no extension point, we currently maintain a full copy of the
standard attribute logic solely to add this one filtering step. This duplicated code
must be re-validated with every Base Application update.
The requested event is minimal, backward-compatible, and follows the existing
OnBefore…OnBeforeLoopIteration+IsHandledpattern already used elsewhere inthis codeunit (e.g.
OnBeforeInsertCategoryItemsAttributeValueMapping). It wouldallow us to delete our duplicated implementation and rely on the standard logic.
I will provide a fix for a bug