Display dialoges
- Johannes Sebastian Nielsen
- Dennis Vibæk
Description
You want to prompt the user to Confirm a message.
Error Message
Simply perform the “ERROR()” command in NAV and the message will be shown on the scanner as an error.
ERROR('This is an error message');
Confirmation Dialog
To display a confirm dialog, you prefix the error message with”ForceWarning:”
The process flow is:
- The user can Cancel or Confirm
- Cancel will return the user to the previous screen
- Confirm will automatically repeat the result, but this time with a “Force” tag included
- The Force tag tells the backend that the Process can now be completed and NOT halted by the ERROR command.
Below is the XML Request from the mobile device to the backend.
- Note how a <Force> tag is included.
- Use this to determine whether to issue the ERROR.
- If the Force tag is included, do NOT run the ERROR, because this is the second "round trip", telling you that the user selected Confirm
- See code example below
IF NOT Force THEN BEGIN ERROR('ForceWarning:' + STRSUBSTNO(MobWmsLanguage.GetMessage('QUANTITY_ERR'),Quantity,ActualQty)); END;
Display dialog when opening an Order
Show a Confirmation Dialog when opening a planned function e.g. Receive, Pick etc.
Modify function GetLockOrderNoAndPrefix_FromBackendID in Codeunit MOB WMS Order Locking
- Add a new XMLNode variable "XMLForceNode"
- Add the following code.
IF MobDocQueue."Document Type" = 'LockOrder' THEN IF UPPERCASE(MobXMLMgt.FindNodeAndValue(XMLRequestDataNode,'Force',XMLForceNode)) <> 'TRUE' THEN ERROR('ForceWarning:My message here');
Display dialog when posting an Order
Show a Confirmation Dialog when posting a planned function e.g. Receive, Pick etc.
This example is for Whse. Receipt.
- Add the following to Codeunit "MOB WMS Receive" and function "PostWhseReceiptOrder"
- Add local text variable "ForceText"
IF NOT MobXMLMgt.GetAttribute(XMLOrderNode,'force',ForceText) then ERROR('ForceWarning:' + 'My message here');
Display dialog based on AdHoc Action
Modify function PostAdhocRegistration in Codeunit MOB WMS Adhoc Registr.
IF NOT Force THEN BEGIN ERROR('ForceWarning:' + STRSUBSTNO(MobWmsLanguage.GetMessage('QUANTITY_ERR'),Quantity,ActualQty)); END;
Add the follwing action on a page i Mobile Configuration Files
<page> <..> <actions> <adhocRegistration id="ShowComments" icon="attachment" title="Show Comments" registrationType="ShowComments"/> <..>
Notes
- Line breaks / Carriage Return, can be performed by using the "\" character in NAV/BC.
- “Unplanned Count” in Codeunit WMS Adhoc Registr.
- When opening a Receive/Pick/Put-away/Move Order, the warning is performed in Codeunit WMS Order Locking
An error message
A confirm dialog, using "ForceWarning"