How-to: Modify Package Number step

Minimum Requirements

  • Extension version MOB5.39
  • Android App version 1.8.0
  • Business Central BC18 (or newer)

Description


Modify Package Number step in Planned functions.

Use case

  • The user wishes to modify the Package Number step, for example by changing its defaultValue.

Behaviour on the device

The Package Number step behaves a bit different from the other steps for Planned functions as it cannot be modified in the application.cfg. Instead, eventsubscribers are needed. 

Example 1: Changing defaultValue and validationValues for the Package Number step in Pick


    // [Example 01]: 'Blank' defaultValue and validationValues to avoid a block when registering a different Package Number than registered before in the same line.

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnGetPickOrderLines_OnAddStepsToAnyLine', '', true, true)]
    local procedure MyOnGetPickOrderLines_OnAddStepsToAnyLine(_RecRef: RecordRef; var _BaseOrderLineElement: Record "MOB Ns BaseDataModel Element"; var _Steps: Record "MOB Steps Element")
    begin
        _Steps.SetRange(name, 'PackageNumber');
        if _Steps.FindFirst() then begin
            _Steps.Set_defaultValue('');
            _Steps.Set_validationValues('');
            _Steps.Save();
        end;
    end;

XML Response example after change

XML Response example
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Documents/Response" messageid="C976B9DA-49A6-4D2C-B989-F35C79FCE7A0" status="Completed">
  <description />
  <responseData xmlns="http://schemas.taskletfactory.com/MobileWMS/BaseDataModel">
    <registrationCollectorConfiguration xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Documents/Response">
      ...
      <Workflow><![CDATA[<registrationCollectorConfiguration tweak="Append">
  <steps>
    <add inputType="Text" id="37" name="PackageNumber" autoForwardAfterScan="true" header="Scan Package No." visible="true" eanAi="92" editable="true" helpLabelMaximize="false" label="Package No.:" labelWidth="100" length="50" optional="false" overDeliveryValidation="Warn" performCalculation="false" primaryInputMethod="Scan" validationCaseSensitive="false" />
  </steps>
</registrationCollectorConfiguration>]]></Workflow>
    </BaseOrderLine>
  </responseData>
</response>
 

 To modify the step in other planned Functions, see also: