Dynamics 365 SCM Warehouse app pop-up windows

Dynamics 365 SCM Warehouse app pop-up windows

We faced an issue with pop-up windows in our current WHS App version. (2.0.11.0)

The issue is: Even if the default field values for the mobile device flow are specified users should confirm default values. 

In our case, we used a warehouse transfer flow with the various default values setups. For instance, one of the setup options is presented on the screenshots below:




However, a pop-up window appears and the user should select the value from the lookup:


But all field values are defined by default based on the default values of the menu item:


From a user perspective, it’s not really convenient to confirm default values after every step since users can make errors because of additional unnecessary confirmation steps. Additionally, it may be quite annoying to have an extra pop-up window where it should not appear. 

It seems there are two options to solve this issue:

1. Upgrading whs app to 2.0.19.0 version. We tested it, there is no such behavior. On the other hand, there is a guarantee that the app will not broke again.
2. It seems possible to change the whs mobile device app behavior via code. This option can be useful if there are some modifications that should be aligned.

Let’s discuss the second option if it is applicable for you.

If we take a look at the user session XML we will see that the Inventory status and To warehouse controls have the DisplayArea tag value - PrimaryInputArea :

<Control InputType="5760" Footer2="" Footer1="" InstructionControl="" AttachedTo="" DataSequence="5" DisplaySubPriority="81" DisplayPriority="90" PreferredInputType="Selection" PreferredInputMode="Manual" DisplayArea="PrimaryInputArea" NumDecimals="-1" Status="1" color="#0076E5" selected="Available" enabled="1" defaultButton="0" error="0" length="-1" type="Undefined" data="||Available||Blocking||Not avail||Rejected" newLine="1" label="Inventory status" name="InventStatusId" controlType="combobox"/>

<Control InputType="9259" Footer2="" Footer1="" InstructionControl="" AttachedTo="" DataSequence="6" DisplaySubPriority="0" DisplayPriority="0" PreferredInputType="Alpha" PreferredInputMode="Scanning" DisplayArea="PrimaryInputArea" NumDecimals="-1" Status="1" color="#0076E5" selected="25" enabled="1" defaultButton="0" error="0" length="-1" type="Undefined" data="15||25" newLine="1" label="To warehouse" name="ToWarehouse" controlType="combobox"/>

The rule seems to be: If the combo box control is in the primary area, a pop-up window will appear.

In order to change the DisplayArea tag we need to create an extension for the WHSMobileAppServiceDecoratorRuleDefaultDisplayArea class. It has some methods and delegates in order to define the control area, for instance:

• isComboboxInPrimaryInputArea and isComboboxInPrimaryInputAreaDelegate for Combobox controls (e.g. units, inventory status and others including developed combobox controls)

• isTextInPrimaryInputArea and isTextInPrimaryInputAreaDelegateisTextInPrimaryInputAreaDelegate for Text controls (e.g. batch number, sales order id and others developed added text controls)

In our case, we need to hide the pop-up windows for the Inventory status and To warehouse controls. In order to do it, the code as below can be written via extension:

protected boolean isComboboxInPrimaryInputArea(boolean             _enabled,

                                               Map                 _controlMap,
                                               str                 _data,
                                               WHSMenuItemName     _menuItemName)
{
    boolean ret;

    ret = next isComboboxInPrimaryInputArea(_enabled, _controlMap, _data, _menuItemName);

    if (_enabled
    &&  _controlMap.lookup(#XMLControlName) == #InventoryStatus)
    {
        return false;
    }

    if (_enabled
    &&  _controlMap.lookup(#XMLControlName) == #ToWarehouse)
    {
        return false;
    }

    return ret;
}

or via delegate:

[SubscribesTo(classStr(WHSMobileAppServiceDecoratorRuleDefaultDisplayArea),
staticDelegateStr(WHSMobileAppServiceDecoratorRuleDefaultDisplayArea,
isComboboxInPrimaryInputAreaDelegate))]
public static void WHSMobileAppServiceDecorator_isComboboxInPrimaryInputAreaDelegate(
                               boolean              _enabled,
                               Map                  _controlMap,
                               str                  _data,
                               WHSMenuItemName      _menuItemName,
                               EventHandlerResult   _result)
{    
    if (_enabled
    &&  _controlMap.lookup(#XMLControlName) == #InventoryStatus)
    {
        _result.result(false);
    }

    if (_enabled
    &&  _controlMap.lookup(#XMLControlName) == #ToWarehouse)
    {
        _result.result(false);
    }
}

NOTE: The code above is an example. The mobile device flow types, and other important conditions are not considered. Please, do not use this code in real implementation projects as it is. It must be adjusted for the real scenario.

After these changes we should not see pop-up window for the Inventory status and To warehouse controls anymore and the user session XML will change as follows:

<Control InputType="5760" Footer2="" Footer1="" InstructionControl="" AttachedTo="" DataSequence="5" DisplaySubPriority="81" DisplayPriority="90" PreferredInputType="Selection" PreferredInputMode="Scanning" DisplayArea="InfoAndSecondaryInputArea" NumDecimals="-1" Status="1" color="#0076E5" selected="Available" enabled="1" defaultButton="0" error="0" length="-1" type="Undefined" data="||Available||Blocking||Not avail||Rejected" newLine="1" label="Inventory status" name="InventStatusId" controlType="combobox"/>

<Control InputType="9259" Footer2="" Footer1="" InstructionControl="" AttachedTo="" DataSequence="6" DisplaySubPriority="0" DisplayPriority="0" PreferredInputType="Alpha" PreferredInputMode="Scanning" DisplayArea="InfoAndSecondaryInputArea" NumDecimals="-1" Status="1" color="#0076E5" selected="25" enabled="1" defaultButton="0" error="0" length="-1" type="Undefined" data="15||25" newLine="1" label="To warehouse" name="ToWarehouse" controlType="combobox"/>

I am glad if this finding can help someone to save their time.

No comments:

How to run batch tasks using the SysOperation framework

Overview As you may know, the system has batch tasks functionality . It can be used to create a chain of operations if you want to set an or...