Use this event to
Create steps for existing and new Unplanned Functions.
See also:
OnGetRegistrationConfiguration_OnAfterAddStep
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAddSteps', '', true, true)]
local procedure OnGetRegistrationConfiguration_OnAddSteps(_RegistrationType: Text; var _HeaderFieldValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text)
begin
end;
Example
// [Example] Get RegistrationConfiguration for RegistrationType=ItemDimensions, add additional step for collecting Cubage (default behaviour is calculating Cubage based on Height*Width*Length)
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnGetRegistrationConfiguration_OnAddSteps', '', true, true)]
local procedure MyOnGetRegistrationConfiguration_OnAddSteps(_RegistrationType: Text; var _HeaderFieldValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text)
var
ItemUoM: Record "Item Unit of Measure";
MobToolbox: Codeunit "MOB Toolbox";
MobWmsLanguage: Codeunit "MOB WMS Language";
MobWmsToolbox: Codeunit "MOB WMS Toolbox";
MobItemReferenceMgt: Codeunit "MOB Item Reference Mgt.";
ItemNo: Code[20];
VariantCode: Code[10];
UnitOfMeasureCode: Code[10];
UoMExists: Boolean;
begin
if _RegistrationType = MobWmsToolbox."CONST::ItemDimensions"() then begin
ItemNo := MobItemReferenceMgt.SearchItemReference(CopyStr(MobToolbox.ReadEAN(_HeaderFieldValues.GetValue('ItemNumber')), 1, 50), VariantCode);
UnitOfMeasureCode := CopyStr(_HeaderFieldValues.GetValue('UnitOfMeasure'), 1, 10);
ItemUoM.Reset();
ItemUoM.SetRange("Item No.", ItemNo);
ItemUoM.SetRange(Code, UnitOfMeasureCode);
UoMExists := ItemUoM.FindFirst();
// STEP: Information step including html (html is supported for InformationStep helpLabel and Whse. Lookup-responses)
_Steps.Create_InformationStep(50, 'Information');
_Steps.Set_header('New dimension');
_Steps.Set_helpLabel(MobWmsLanguage.GetMessage('ENTER_CUBAGE') + ' <b><font color="red">in m3</font></b>');
// STEP: Cubage (from 'Quantity' Template)
_Steps.Create_DecimalStep_Quantity(55, ItemNo);
_Steps.Set_name('Cubage');
_Steps.Set_header(MobWmsLanguage.GetMessage('ENTER_CUBAGE'));
_Steps.Set_label(MobWmsLanguage.GetMessage('CUBAGE_LABEL') + ':');
_Steps.Set_eanAI('');
if UoMExists then
_Steps.Set_defaultValue(ItemUoM.Cubage);
_Steps.Set_minValue(0);
end;
end;
More examples
-
How-to: Add action to Order Line menu — Add a new Unplanned Function as action on Pick Lines.
-
How-to: Create custom Lookup Function — Adding a new custom Lookup function with one "Header field" to show simple lookup response.
-
How-to: Create custom Unplanned function in Main Menu — The most common control for customization
Add a new function to the Main menu. "Header fields" and optional "Steps" to collect
-
How-to: Production Output - Implement a Unit of Measure step — For Items with multiple Unit of Measure codes
Version History
Version | Changes |
---|---|
MOB5.14 | Introduced |
MOB5.15 | Parameter _RegistrationTypeTracking changed from Text[200] to Text |
MOB5.15 | Parameter _HeaderFilter renamed to _HeaderFieldValues |