Use this event to
...
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnGetPickOrders_OnAfterSetFromAnyHeader', '', true, true)]
procedure OnGetPickOrders_OnAfterSetFromAnyHeader(_RecRef: RecordRef; var _BaseOrderElement: Record "MOB Ns BaseDataModel Element")
begin
end;
Example 1
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnGetPickOrders_OnAfterSetFromAnyHeader', '', true, true)]
procedure MyOnGetPickOrders OnGetPickOrders_OnAfterSetFromAnyHeader(_RecRef: RecordRef; var _BaseOrderElement: Record "MOB Ns BaseDataModel Element")
var
DataTypeManagement: Codeunit "Data Type Management";
NewFieldRef: FieldRef;
begin
if DataTypeManagement.FindFieldByName(_RecRef, NewFieldRef, 'Assigned User ID') then
_BaseOrderElement.SetValue('MyAssignedUserID', 'Assigned to: ' + CopyStr(NewFieldRef.Value(), 1, NewFieldRef.Length()));
_BaseOrderElement.Set_DisplayLine2('Set from OnGetPickOrders_OnAfterSetFromAnyHeader'); // override value previously set at table event
end;
Example 2
// [Example]: Sort by custom tag
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnGetPickOrders_OnAfterSetFromAnyHeader', '', true, true)]
procedure SortByCustomTag_OnGetPickOrders_OnAfterSetFromAnyHeader(_RecRef: RecordRef; var _BaseOrderElement: Record "MOB Ns BaseDataModel Element")
var
DataTypeManagement: Codeunit "Data Type Management";
NewFieldRef: FieldRef;
begin
with _BaseOrderElement do begin
if DataTypeManagement.FindFieldByName(_RecRef, NewFieldRef, 'Assigned User ID') then
SetValue('AssignedUserID', 'Assigned to: ' + CopyStr(NewFieldRef.Value(), 1, NewFieldRef.Length()));
Set_Sorting1(CopyStr(GetValue('AssignedUserID'), 1, MaxStrLen("Sorting1 (internal)")));
Set_Sorting2(CopyStr(Get_ItemNumber(), 1, MaxStrLen("Sorting2 (internal)")));
end;
end;
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...