Skip to content

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

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

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