-
Notifications
You must be signed in to change notification settings - Fork 687
Open
Description
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&OnAfterValidateNobut as we want to add a TestField after theItem.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
Labels
No labels