-
Notifications
You must be signed in to change notification settings - Fork 685
Open
Labels
SCMGitHub request for SCM areaGitHub request for SCM areaevent-requestRequest for adding an eventRequest for adding an event
Description
Why do you need this change?
In order to be able to transfer additional description field from Item or Variant to Assembly header, additional integration events are needed.
Descriptions From Item
in function SetDescriptionsFromItem() add event OnUpdateDescriptionsFromItem:
local procedure SetDescriptionsFromItem()
begin
GetItem();
Description := Item.Description;
"Description 2" := Item."Description 2";
/// Change Start
OnUpdateDescriptionsFromItem(Rec,Item);
/// Change End
end;
integration event
[IntegrationEvent(false, false)]
local procedure OnUpdateDescriptionsFromItem(var AssemblyHeader: Record "Assembly Header"; Item: Record Item)
begin
end;
Descriptions from Variant Code
In OnValidate trigger for "Variant Code" field add event OnUpdateDescriptionsFromVariantCode:
field(12; "Variant Code"; Code[10])
{
Caption = 'Variant Code';
TableRelation = "Item Variant".Code where("Item No." = field("Item No."),
Code = field("Variant Code"));
trigger OnValidate()
var
ItemVariant: Record "Item Variant";
IsHandled: Boolean;
begin
CheckIsNotAsmToOrder();
TestStatusOpen();
SetCurrentFieldNum(FieldNo("Variant Code"));
if Rec."Variant Code" = '' then
SetDescriptionsFromItem()
else begin
ItemVariant.SetLoadFields(Description, "Description 2", Blocked);
ItemVariant.Get("Item No.", "Variant Code");
ItemVariant.TestField(Blocked, false);
Description := ItemVariant.Description;
"Description 2" := ItemVariant."Description 2";
/// Change Start
OnUpdateDescriptionsFromVariantCode(Rec,ItemVariant);
/// Change End
end;
IsHandled := false;
OnValidateVariantCodeOnBeforeValidateDates(Rec, xRec, IsHandled);
if not IsHandled then
ValidateDates(FieldNo("Due Date"), true);
IsHandled := false;
OnValidateVariantCodeOnBeforeUpdateAssemblyLines(Rec, xRec, CurrFieldNo, CurrentFieldNum, IsHandled);
if not IsHandled then
AssemblyLineMgt.UpdateAssemblyLines(Rec, xRec, FieldNo("Variant Code"), false, CurrFieldNo, CurrentFieldNum);
AssemblyHeaderReserve.VerifyChange(Rec, xRec);
GetDefaultBin();
Validate("Unit Cost", GetUnitCost());
ClearCurrentFieldNum(FieldNo("Variant Code"));
end;
}
integration event
[IntegrationEvent(false, false)]
local procedure OnUpdateDescriptionsFromVariantCode(var AssemblyHeader: Record "Assembly Header"; ItemVariant: Record "Item Variant")
begin
end;
Describe the request
In our product for the Items and Variants we have additional description field witch need to be transferred to Assembly Header.
Internal work item: AB#617063
Metadata
Metadata
Assignees
Labels
SCMGitHub request for SCM areaGitHub request for SCM areaevent-requestRequest for adding an eventRequest for adding an event