Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Two pages that will:

  1. Show ("look up") a list of entries 
  2. Make registration regarding each entry on the list (An "Unplanned Item Registration")


Use case examples

  • You want to search for and display a list of outstanding "items" to "handle".
  • When you have handled each item, you want that item to disappear from the list and proceed to the next item.

or

  • You want to search for and display a list of Jobs.
  • Select one or more job and make registrations of Items or Hours etc. spent on that job.


How to use it

Defining the pages

Step 1: Defining the Lookup

Below is sample code for a Lookup called "MyLookup"


Code Block
languagevb
titleAdd to application.cfg
<page id="MyLookup" type="Lookup" icon="mainmenuscaninfo">
  <title defaultValue="Titel"/>
  <lookupConfiguration type="MyLookup">
    <header configurationKey="MyLookup" automaticAcceptOnOpen="true" />
    <onResultSelected enabled="true" refreshOnSuccess="true" navigateTo="MyItemReg"/>
    <list listId="Lookup" />
  </lookupConfiguration>
  <actions>
    <open id="MyItemReg" icon="mainmenusettings" title="My UnplannedItemRegistration">
      <transfer property="LookupSelectedResult" to="UnplannedItemRegistrationInputValue"></transfer>
      <returnTransfer property="UnplannedItemRegistrationCompleted" to="RefreshOnResume"/>
    </open>
  </actions>
</page>


Step 2: Unplanned Item Registration 

Below is sample code for an Unplanned Item Registration called "MyItemReg"


Code Block
languagevb
titleAdd to application.cfg
<page id="MyItemReg" type="UnplannedItemRegistration" icon="mainmenuscaninfo">
  <title defaultValue="Titel"/>
  <unplannedItemRegistrationConfiguration type="MyItemReg" includeInputDataRowInSubmitRequest="true" useRegistrationCollector="true">
    <header configurationKey="MyItemReg" clearAfterPost="true" automaticAcceptOnOpen="true" automaticAcceptAfterLastScan="true"/>
    <onSuccessfulPost close="true" />
  </unplannedItemRegistrationConfiguration>
</page>

Please note:

For simplicity the Page id, Registration key and Header Key are all name the same.

  • Page id uniquely identifies the page in the config file

  • Registration key is how the back-end will identify the Unplanned Item Registration (including the Collector Steps)

  • Header key  is how the back-end will identify the Input fields shown on the top of the page. 


Step 3: Add the main menu items

Code Block
languagevb
titleAdd to application.cfg
<!-- PAGES -->
<pages>
  <page id="MainMenu" type="Menu" icon="icon">
    <title defaultValue="Mobile WMS" />
    <menuConfiguration>
      <menuItems>          
		...
        <menuItem id="MyLookup" displayName="MyLookup" icon="mainmenumove-unplanned" alwaysEnabled="true"/>
        <menuItem id="MyItemReg" displayName="MyItemReg" icon="mainmenushipping" alwaysEnabled="true"/>
        ...


Handling the back-end

Step 4: Defining a shared Header for the Pages

This will define the field(s) displayed on the top of the Lookup aka the search criteria.

But it will also enable the MyItemReg page to "Receive" this information.


So the header will be shared between the two pages.


For simplicity we will only have a field called "ID".



This is defined in Codeunit "MOB WMS Reference Data"


Code Block
CreateConfig(XMLResponseData,'MyLookup');
CreateConfig(XMLResponseData,'MyItemReg');



Code Block
'MyLookup','MyItemReg': MyLookupAndMyItemReg(XMLCDataSection);


Code Block
MyLookupAndMyItemReg(VAR XmlCDataSection : DotNet "System.Xml.XmlCDataSection")
// Used for Custom05UnplannedItemReg

AddConfHeaderTextValue(XmlCDataSection,
                       1,                 //id
                       'ID',              //name
                       'Enter ID:',       //label
                       100,               //label width
                       TRUE,              //clear on clear
                       TRUE,              //accept barcode
                       20,                //length
                       TRUE,              //optional
                       '',                //search type
                       '',                //eanAi
                       FALSE);


Step 5: Handling the Request for Lookup 

This is the code that will return the list of results and entries that you require.

We will have some dummy Line data.


This is defined in Codeunit "MOB WMS Lookup"

Code Block
LOCAL MyLookup(XMLRequestDoc : DotNet "System.Xml.XmlDocument")
// Extract any parameters from the XML
// The parameters are located in the <requestData> element
// The "Lookup bin content" supplies two parameters:
// Location and Bin
// The names of the XML elements are determined by the LookupBinContentConfiguration supplied as reference data

MobXMLMgt.GetDocRootNode(XMLRequestDoc, XMLRequestNode);
MobXMLMgt.FindNode(XMLRequestNode, 'requestData', XMLRequestDataNode);

// Initialize the response xml
MobBaseToolbox.InitializeResponseDocWithNS(XMLResultDoc, XMLResponseData,
                                          'http://schemas.taskletfactory.com/MobileWMS/WarehouseInquiryDataModel');
REPEAT
  MobXMLMgt.AddElement(XMLResponseData, 'LookupResponse', '', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLLookupResponse);

  // Add the data elements to the <LookupResponse> element
  MobXMLMgt.AddElement(XMLLookupResponse, 'Location', 'Location xxx', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'ID', 'LinkLookupToReg', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'DisplayLine1', 'Line 1', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'DisplayLine2', 'Line 2', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'DisplayLine3', 'Line 3', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'DisplayLine4', 'Line 4', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'DisplayLine5', 'Line 5', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'ExtraInfo1', '', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'ExtraInfo2', '', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);
  MobXMLMgt.AddElement(XMLLookupResponse, 'ExtraInfo3', '', MobXMLMgt.GetNodeNSURI(XMLResponseData), XMLCreatedNode);

  Int += 1;
UNTIL Int = 3;


Step 6: Defining the "Steps" to collect 

This is the code that will return the list of results and entries that you require.


This is defined in Codeunit "MOB WMS Adhoc Regstr."



Code Block
'MyItemReg':
    BEGIN
      MyItemReg(XMLRequestDoc);
    END;



Code Block
LOCAL MyItemReg(XMLRequestDoc : DotNet "System.Xml.XmlDocument")
// Extract any parameters from the XML
// The parameters are located in the <requestData> element
// The Unplanned Move feature expects 2 header values
// Location and Item
MobXMLMgt.GetDocRootNode(XMLRequestDoc, XMLRequestNode);
MobXMLMgt.FindNode(XMLRequestNode,MobWMSToolbox."CONST::requestData",XMLRequestDataNode);

// -- Now find the location parameter
// -- Now find the item parameter
MobXMLMgt.FindNode(XMLRequestDataNode,'ID',XMLParameterNode);
// -- Get the parameter

// Validation
// Now we have the parameters -> determine which registrations to collect

// Initialize the response xml
// It is important that the xmlns="" attribute is not added, because it will prevent the configuration from loading
MobBaseToolbox.InitializeRespDocWithoutNS(XMLResultDoc,XMLResponseData);

// Add the <registrationCollectorConfiguration> element
MobXMLMgt.AddElement(XMLResponseData,'registrationCollectorConfiguration','',
                     MobXMLMgt.GetDocNSURI(XMLResultDoc),
                     XMLRegCollectorConfiguration);

// Add the <steps> element to the <registrationCollectorConfiguration>
MobXMLMgt.AddElement(XMLRegCollectorConfiguration,'steps','',MobXMLMgt.GetDocNSURI(XMLResultDoc),XMLSteps);

// Add the steps
DetermineUnpMoveItemTracking(ItemNo,RegisterSerialNumber,RegisterLotNumber,RegisterExpirationDate);

// From Bin
// Set the basic required values
MobConfTools.RC_Std_Parms(1,
                          'SomeText',
                          'Collecting some text',
                          '',
                          'Please enter some text');

// Create the step
MobConfTools.RC_Text_XmlNode(XMLSteps,
                             '',
                             20);



This will produce one collector step.

Asking for a text value.


Step 7: Handling the "posting" of Unplanned Item Registration

This code read the collected data and posts it.

If this code makes changes to the data the Lookup uses, you will see the result of the posting when the returning to the Lookup.


This is defined in Codeunit "MOB WMS Adhoc Regstr."


Code Block
'MyItemReg':
  BEGIN
    Status := PostMyItemReg(XMLRequestDoc);
    MobBaseToolbox.CreateSimpleResponse(XMLResultDoc,Status);
  END;

...And here you need to add your custom post function called "PostMyItemReg"Create function "PostMyItemReg" by copying an existing posting function.

  • Modify the new function to read the "ID" and "SomeText" values.





The lookup


The Unplanned Item Registration