Use this event to
Excerpt |
---|
Add steps to be displayed at the mobile device when collecting values for each individual document line. |
Description
Steps New steps defined at line level (collected for each individual line) are merged with steps from your existing workflow defined in application.cfg
You may add custom steps using either a the _Steps-parameter or a ConfigurationKey to be declared in Reference Data.
The Using the _Steps-parameter is the easiest and most flexible to use, but you may consider using a ConfigurationKey when performance or backwards compatibility with older Android Apps is more important to you.
...
Using _Steps-parameter | Using ConfigurationKey from ReferenceData |
---|---|
Easier syntax (Steps defined on-the-fly) | More difficult to use (requires ConfigurationKey in ReferenceData) |
Multiple subscribers to same OnAddSteps event is possible | Only a single subscriber must exist to same OnAddSteps event |
Performance cost is 5%-10% per step added to order lines | No performance cost per additional step |
Minimum requirements are Mobile WMS 5.39 and Android App 1.8 | Minimum requirement is Mobile WMS 5.11 |
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS ReceiveMOB WMS Receive", 'OnGetReceiveOrderLines_OnAddStepsToAnyLine', '', truetrue, truetrue)]
local procedure OnGetReceiveOrderLines OnGetReceiveOrderLines_OnAddStepsToAnyLine(_RecRef: RecordRef; var _BaseOrderLineElement: Record "MOB Ns BaseDataModel ElementRecord "MOB Ns BaseDataModel Element"; var _Steps: Record "MOB Steps Element")
begin
end;
Example 1:
...
Add line steps by using _Steps-parameter
...
were
...
// Prerequisites: Mobile WMS 5.39 and Android App 1.8
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Receive", 'OnGetReceiveOrderLines_OnAddStepsToAnyLine', '', true, true)]
localprocedure My01OnGetReceiveOrderLines_OnAddStepsToAnyLine(_RecRef: RecordRef; var _BaseOrderLineElement: Record "MOB NS BaseDataModel Element"; var _Steps: Record "MOB Steps Element")
begin
// if not (_BaseOrderLineElement.Get_UnitOfMeasure() in ['KG', 'GR']) then // Example: Condition based on input
// exit;
_Steps.Create_DecimalStep(20000, 'CustomCatchWeight');
_Steps.Set_header('Catch Weight (Grams)');
_Steps.Set_label('Catch Weight (Grams):');
_Steps.Set_helpLabel('Catch Weight in Grams (Total Weight)');
_Steps.Set_minValue(0);
_Steps.Set_maxValue(100000);
_Steps.Set_performCalculation(true);
end;
Example 2: Add line steps by referencing a ConfigurationKey from ReferenceData
Currently Mobile WMS supports only one (custom) referenced key per Order Line, meaning only one customization may create StepsByReferenceDataKey at any time. This single one subscriber must set a Key that includes all steps for all other intended subscribers as well. This can only be done by knowing other customizations are in place and manually create a new RegistrationCollectorConfigurationKey that includes all steps.
// [Example]: Add steps referenced by new RegistrationCollectorConfiguration-Key to line steps collectors
Prerequisites: Mobile WMS 5.11
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS ReceiveMOB WMS Receive", 'OnGetReceiveOrderLines_OnAddStepsToAnyLine', '', truetrue, truetrue)]
local procedure MyOnGetReceiveOrderLines My02OnGetReceiveOrderLines_OnAddStepsToAnyLine(_RecRef: RecordRef; var _BaseOrderLineElement: Record "MOB NS BaseDataModel ElementMOB NS BaseDataModel Element")
begin
_BaseOrderLineElement.Create_StepsByReferenceDataKey('CustomReceiveSteps');
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference DataMOB WMS Reference Data", 'OnGetReferenceData_OnAddRegistrationCollectorConfigurations', '', truetrue, truetrue)]
local procedure MyOnGetReferenceData My02OnGetReferenceData_OnAddRegistrationCollectorConfigurations(var _Steps: Record "MOB Steps ElementMOB Steps Element")
begin
_Steps.InitConfigurationKey('CustomReceiveSteps');
_Steps.Create_DecimalStep(10000, 'CustomNetWeightGrams');
_Steps.Set_header('Net Weight Net Weight (Grams)');
_Steps.Set_label('Net Weight Net Weight (Grams):');
_Steps.Set_helpLabel('Net Weight in Grams per Base Unit of MeasureNet Weight in Grams per Base Unit of Measure');
_Steps.Set_minValue(0);
_Steps.Set_maxValue(100000);
_Steps.Set_performCalculation(true);
end;
Sorting Steps for order lines
...