Delete WHS Mobile Device Portal User Session in AX2012

To test the “new” WHS Mobile Device Portal in AX 2012 R3, one can use the WHSWorkExecute form (a nifty WMDP emulator). But while creating a new form inside the WMDP, I managed it to get stuck in a blank form, with no way out.
On top it seems like the actual session is saved in the WHSWorkUserSession table and even after logoff / logon the blank form comes up. So I created a small dialog to reset the user data, like in my post about creating a custom lookup.

TLDR: Delete the line realated to your WHSUserId in the WHSWorkUserSession table, to completly reset your user session.

First we create a new class which extends RunBase.



Next we add a main method, create a new object of the class and call a method (resetUserSession()), which we will create in a second.

Then we add the dialog() method where we get the WHSUserId and also getting the control to finally override the lookup().

The WHSUserId is the UserId we want to reset later.

Now we add the lookup to choose the UserId, I added the InventLocationId and the LastActionDateTime, to better distinguish the entries.

At least we add the resetUserSession(). We just use the value from the lookup and search the entry in the WHSWorkUserSession table, if we find a line, we are trying to delete the session and commit the changes.

Reset the WHS User Session in action:

This it what it looks like, if one hit OK, the WHS work user session will be deleted.
AX2012 WHS MDP Delet User Session


You may also like...