state diagram

The Warehouse Mobile Device Portal (WMDP) in AX 2012 provides a strong interface for the warehouse workers to use the advanced warehousing functionality. One can use variety of functions like Sales and Transfer Order picking, Inventory movement and numerous inbound and outbound warehouse tasks. This functionality can almost run on any handheld device which supports basic internet browser or a browser emulator. The thing which makes WMDP even more powerful is that you can customize it according to your own business needs. Today my main focus will be on covering the technical aspects of customizing the portal. To gain a greater insight in the customization we will try to introduce a new workflow in our existing mobile device portal.

State Diagram for the Custom WorkFlow
Now before starting the customization formally let’s try to create a State Diagram for our new workflow. The state diagram must have clear transitions between its states, this task will help us to understand the requirements even better and at the end of it we will be having a blueprint of the workflow that we are trying to integrate in our portal.  The new workflow I am introducing is “Warehouse to Warehouse Single Item Transfer”. This workflow have also the capability to change the current License plate of the specified item. Currently there is no such functionality in AX mobile device portal.

state diagram

The state diagram is simple, at first state we will create a form to get the information about the item we are going to transfer. If validated we will proceed to the next state where a new form will be made to get the information of the new warehouse where the specified item will be transferred. In the third state we will process the transfer. After successful transfer we will return to the initial state otherwise to the second state.

Enumerations to Initialize the Custom Workflow:
As I am adding the workflow as an “Indirect Mode”, the enumeration “WHSWorkActivity” needs to updated with a new element. The name of the element should be something related to the workflow, in my case it is “ItemTransfer”.

whs work Activity

 

Before moving forward there is another enumeration which is needed to be update i.e. “WHSWorkExecuteMode”. The “WHSWorkExecuteMode” enumeration is a superset of the “WHSWorkActivity” enumeration. Keep in mind that the name and label of the new element in both enumeration should be same or it will cause problems to initialize.

whs work execute mode

In order to increase the code readability I have made a new enumeration named “ItemTransferStep”. This enumeration is not at all necessary, It is used for defining the workflow states in a more user friendly way.

item transfer step

WHS Work Execute Display Class:

Since all the initial necessary steps are done we will now create the core processing class which will process our workflow. All the classes introducing new workflow for the Mobile Device Portal should be inherited from “WHSWorkExecuteDisplay” class. WHSWorkExecuteDisplay is an abstract class and all the classes inheriting from it should implement the “displayForm” method. The display form method is the entry point of any mobile device workflow. I have named my processing class “WHSWorkExecuteDisplayItemTransfer”. The displayForm method of our class is as follows

displayform method

The lines of code enclosed in the red rectangle calls a standard method in “WHSRFControlData” class. The “processData” method validates the entered data, if validated the data is inserted in a Map named “Pass”. The values present in the map are processed accordingly by the workflow classes.

Building Controls on Mobile Device Portal Forms:

In order to build controls on our portal forms the “buildControl” method is used. It is provided by “WHSWorkExecuteDisplay” class. A variety of controls can be made using this method. For more details about this method you can check the official documentation. As an example refer to the screenshot below.build control

 

The output form generated by the above screenshot is as follows

first form

 

Similarly the form built on the second state of the workflow is as follows

second

 

In order to achieve this functionality I have used the Inventory Movement. After validation of data my custom class makes a work order which can be seen in Warehouse Management Module in AX. If the transfer is done successfully the work order created should be in the closed state. The pictorial view of the final state is as follows

final

As you can see the control returns to our first form after successful transfer with the “Work Completed” message at the top. The work order created by our custom workflow is as follows

final work order

 

We can also see the impact of this Work Order on the On Hand Inventory.

on hand final

I hope that this article has given you all some insight on the Mobile Device Portal customizations. In the next article I will try to cover the information about the Mobile Device Menus and how can we add menu items in it. Until then keep visiting our blog site https://www.axpulse.com/blogs for exciting and insightful information about Microsoft Dynamics and CRM.

Leave a Reply

Recent Comments

    Archives

    Categories