Add a Collector Step (Header Level)

Description

Collect additional information on Header basis (alternative to Line level).

This information is collected when a document is posted. This happens after the line information has been registered.

For example

I.e. when posting a Receive order, an Delivery Note is collected as standard.

How to use it

In the following two different solutions are demonstrated.

Choose the right example for your task.

Example 1: You are using Warehouse Documents

Example 2: You are Picking/Receiving directly on Orders


Example 1: (Warehouse Documents)

Step 1: Collect two additional Text Steps

Below is sample code for collection two additional Text Steps.


Insert the following code block in Function "CreateWhseActLinesResponse" in Codeunit 6181388 WMS Toolbox


Insert into: Codeunit 6181388 WMS Toolbox
// >>>> CUSTOM HEADER STEPS

// Add the order level registration configuration
// Add the <registrationCollectorConfiguration> element
MobXMLMgt.AddElement(XMLResponseData,                             // Add to this Node
                     'registrationCollectorConfiguration',        // Name
                     '',                                          // Text
                     XMLResultDoc.DocumentElement.NamespaceURI,   // NameSpace
                     XMLRegCollectorConfiguration);               // New created node

// Add the <steps> element to the <registrationCollectorConfiguration>
MobXMLMgt.AddElement(XMLRegCollectorConfiguration,'steps','',XMLResultDoc.DocumentElement.NamespaceURI,XMLSteps);
// Init collector parameters
MobConfTools.RC_Std_Parms(1,                   // ID
                          'Text1',             // Name
                          'Enter some data',   // Header
                          'Data',              // Label
                          '');                 // Help Label
MobConfTools.RC_Text_XmlNode(XMLSteps,'',20);
MobConfTools.RC_Std_Parms(2,                   // ID
                          'Text2',             // Name
                          'Enter more data',   // Header
                          'More data',         // Label
                          '');                 // Help Label
// Create collector XML-Node
MobConfTools.RC_Text_XmlNode(XMLSteps,'',20);

// <<<< CUSTOM HEADER STEPS



Step 2: Read and handle the collected data 


Insert the following code block in the top of Function "PostWhseActOrder" in Codeunit 6181388 WMS Toolbox

Insert into: Codeunit 6181388 WMS Toolbox
// >>>> CUSTOM HEADER STEPS

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

// The requestData element only contains one Order element (validated by the schema)
MobXMLMgt.GetNodeFirstChild(XMLRequestDataNode, XMLOrderNode);

// Get the Custom step value
MobXMLMgt.GetAttribute(XMLOrderNode,'Text1',AttributeValue);
MobXMLMgt.GetAttribute(XMLOrderNode,'Text2',AttributeValue);

ERROR('Step value %1',AttributeValue);

// <<<< CUSTOM HEADER STEPS


The error message will be shown on the mobile device.

You will need to handle the collected values from here on.






Example 2: (Order Documents)

Step 1: Collect two additional Text Steps

Below is sample code for collection two additional Text Steps.


Insert the following code block in the respective functional Codeunit (Receive,Pick etc.)

After the call to "InitializeOrderLineDataRespDoc"



Block 1: Codeunit "MOB WMS Receive/Pick/Ship/Put-away/Count/Move
// >>>> CUSTOM HEADER STEPS

// Add the order level registration configuration
// Add the <registrationCollectorConfiguration> element
MobXMLMgt.AddElement(XMLResponseData,                             // Add to this Node
                     'registrationCollectorConfiguration',        // Name
                     '',                                          // Text
                     XMLResultDoc.DocumentElement.NamespaceURI,   // NameSpace
                     XMLRegCollectorConfiguration);               // New created node

// Add the <steps> element to the <registrationCollectorConfiguration>
MobXMLMgt.AddElement(XMLRegCollectorConfiguration,'steps','',XMLResultDoc.DocumentElement.NamespaceURI,XMLSteps);
// Init collector parameters
MobConfTools.RC_Std_Parms(1,                   // ID
                          'Text1',             // Name
                          'Enter some data',   // Header
                          'Data',              // Label
                          '');                 // Help Label
MobConfTools.RC_Text_XmlNode(XMLSteps,'',20);
MobConfTools.RC_Std_Parms(2,                   // ID
                          'Text2',             // Name
                          'Enter more data',   // Header
                          'More data',         // Label
                          '');                 // Help Label
// Create collector XML-Node
MobConfTools.RC_Text_XmlNode(XMLSteps,'',20);

// <<<< CUSTOM HEADER STEPS



Step 2: Handle the collected data 


Codeunit 6181374 WMS Pick
// >>>> CUSTOM HEADER STEPS

MobXMLMgt.GetAttribute(XMLOrderNode,'Text1',AttributeValue);
MyText1Variable := AttributeValue;


MobXMLMgt.GetAttribute(XMLOrderNode,'Text2',AttributeValue);
MyText2Variable := AttributeValue;

// << HEADER STEP


You will need to handle the collected values from here on.