Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

[Event Request] table 27 Item - OnUpdateItemUnitOfMeasureWeightOnBeforeCalcWeight() #30442

Closed

Description

Why do you need this change?

We have a customization to update item weight from base unit of measure.
This code updates all units of measure when updating weight.
I need to be able to exclude the base unit of measure.

    local procedure UpdateItemUnitOfMeasureWeight()
    var
        ItemUOM: Record "Item Unit of Measure";
    begin
        if IsTemporary then
            exit;

        if "No." = '' then
            exit;

        ItemUOM.SetRange("Item No.", "No.");
        ///
       OnUpdateItemUnitOfMeasureWeightOnBeforeCalcWeight(Item,ItemUOM)
        ///
        if ItemUOM.FindSet(true) then
            repeat
                ItemUOM.CalcWeight(ItemUOM."Qty. per Unit of Measure", "Net Weight");
                ItemUOM.Modify();
            until ItemUOM.Next() = 0;
    end;
    [IntegrationEvent(false, false)]
    local procedure OnUpdateItemUnitOfMeasureWeightOnBeforeCalcWeight(var Item: Record Item; var ItemUnitOfMeasure: Record "Item Unit of Measure")
    begin
    end;

Describe the request

We have a customization to update item weight from base unit of measure.
This code updates all units of measure when updating weight.
I need to be able to exclude the base unit of measure.
Internal work item: AB#648438

Activity

  1. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    ✅ Analysis complete - ready for further processing


    Implementation:

    Add a new integration event in UpdateItemUnitOfMeasureWeight() in table 27 Item before FindSet(true) so extensions can adjust the Item Unit of Measure filter before weights are recalculated.

    Location in UpdateItemUnitOfMeasureWeight() procedure:

    local procedure UpdateItemUnitOfMeasureWeight()
    var
        ItemUOM: Record "Item Unit of Measure";
    begin
        if IsTemporary then
            exit;
    
        if "No." = '' then
            exit;
    
        ItemUOM.SetRange("Item No.", "No.");
        OnUpdateItemUnitOfMeasureWeightOnBeforeCalcWeight(Rec, ItemUOM);
        if ItemUOM.FindSet(true) then
            repeat
                ItemUOM.CalcWeight(ItemUOM."Qty. per Unit of Measure", "Net Weight");
                ItemUOM.Modify();
            until ItemUOM.Next() = 0;
    end;

    Event Publisher (add at the end of the codeunit with other events):

    [IntegrationEvent(false, false)]
    local procedure OnUpdateItemUnitOfMeasureWeightOnBeforeCalcWeight(var Item: Record Item; var ItemUnitOfMeasure: Record "Item Unit of Measure")
    begin
    end;

    File: Item.Table.al

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  2. JesperSchulz commented on Sep 3, 2026

    @JesperSchulz
    Contributor

    The requested change has been implemented in microsoft/BCApps#10903, and the corresponding Azure Boards work item 648438 is resolved as fixed. Closing this issue as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventext-ready-to-implementReviewed and ready to implement and create PR

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions