Skip to content

[Event Request] Table 99000772 Production BOM Line #29632

@aulon97

Description

@aulon97

Why do you need this change?

Please add a new integration event in the OnValidate trigger of the "No." field in table "Production BOM Line".
The event should be placed before the call to Item.TestField('Base Unit of Measure'), and should include a var IsHandled: Boolean parameter, allowing subscribers to bypass this TestField call if needed.

We have explored the following alternative events:

  • OnValidateNoOnAfterAssignItemFields & OnAfterValidateNo but as we want to add a TestField after the Item.TestField("Base Unit of Measure"); those event will not fulfill our purpose

Justification for IsHandled:
We need to use IsHandled because without it standard code would trigger additional validations that conflict with custom process.

Describe the request

Requested event placement and usage:

            trigger OnValidate()
            var
                Item: Record Item;
                IsHandled: Boolean; //New Variable
            begin
                TestField(Type);

                TestStatus();

                case Type of
                    Type::Item:
                        begin
                            IsHandled := true;
                            Item.Get("No.");
                            OnValidateNoOnBeforeAssignItemFields(Rec, Item, xRec, CurrFieldNo, IsHandled); //New Event
                            if IsHandled then // New Code
                                exit;
                            Description := Item.Description;
                            Item.TestField("Base Unit of Measure");
                            "Unit of Measure Code" := Item."Base Unit of Measure";
                            "Scrap %" := Item."Scrap %";
                            if "No." <> xRec."No." then
                                "Variant Code" := '';
                            OnValidateNoOnAfterAssignItemFields(Rec, Item, xRec, CurrFieldNo);
                        end;
                    Type::"Production BOM":
                        begin
                            ProductionBOMHeader.Get("No.");
                            ProductionBOMHeader.TestField("Unit of Measure Code");
                            Description := ProductionBOMHeader.Description;
                            "Unit of Measure Code" := ProductionBOMHeader."Unit of Measure Code";
                            OnValidateNoOnAfterAssignProdBOMFields(Rec, ProductionBOMHeader, xRec, CurrFieldNo);
                        end;
                end;

                OnAfterValidateNo(Rec);
            end;

Event signature:

 [IntegrationEvent(false, false)]
    local procedure OnValidateNoOnBeforeAssignItemFields(var ProductionBOMLine: Record "AL Production BOM Line"; Item: Record Item; var xProductionBOMLine: Record "AL Production BOM Line"; CallingFieldNo: Integer; IsHandled: Boolean)
    begin
    end;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions