Versions Compared

Key

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

...

This article describes how to add a new custom action to the context menu or "BurgerMenu" at existing pagesor action menus.

In this example a menu item is added to the Pick order lines list, to send instructions to a Pick Robot to fetch an item from warehouse and move to the physical pick area. While no instructions are actually issued to a Pick Robot in this example, it will show how to create the neccessary pages and how to trigger custom code in the backend.

...

Code Block
title codeunit 6181381 "MOB WMS Reference Data"
local procedure AddHeaderConfigurationAddConfiguration(var XMLResponseData: XmlNode);
begin   
  [.....]
  CreateConfig(XMLResponseData,REGISTER_IMAGE_HEADER);
  // >> SendToPickRobot
     CreateHeaderConfiguration(XMLResponseData, CreateConfig(XMLResponseData,CREATE_ASSEMBLY_ORDER_HEADER);
  CreateConfig(XMLResponseData,ADJUST_QTY_TO_ASSEMBLE_HEADER);
  CreateConfig(XMLResponseData,ATTACHMENTS_HEADER);
  CreateConfig(XMLResponseData,'SendToPickRobotHeader');
     // << SendToPickRobot
     [.....]
	//<----
end;


Code Block
title codeunit 6181381 "MOB WMS Reference Data"
procedure CreateHeaderConfiguration(var XMLResponseData: XmlNode; "Key": Text[50]);
varbegin
     [.....]
begin 	 [.....]
     POST_SHIPMENT_HEADER_Txt ADJUST_QTY_TO_ASSEMBLE_HEADER:
    BEGIN
      AddPostShipmentHeaderValuesAddAdjustQtyToAssembleHeaderValues(XMLCDataSection);
    END;
// >> SendToPickRobot
     'SendToPickRobotHeader' ATTACHMENTS_HEADER:
    BEGIN
      AddSendToPickRobotHeaderValuesAddAttachmentsHeaderValues(XMLCDataSection);
    END;
  'SendToPickRobotHeader': 									//<----
<< SendToPickRobot     AddSendToPickRobotHeaderValues(XMLCDataSection);	    [.....]//<----
end;


Code Block
title codeunit 6181381 "MOB WMS Reference Data"
// >> SendToPickRobot
local procedure AddSendToPickRobotHeaderValues(var XmlCDataSection: XmlCdata);
begin
    // Add the header lines
    AddConfHeaderTextValue(XmlCDataSection,
                           1,                 //id
                           'OrderBackendID',  //name
                           MobWmsLanguage.GetMessage('BATCH_NAME') + ':',  //label
                           100,               //label width
                           false,             //clear on clear
                           false,             //accept barcode
                           20,                //length
                           false,             //optional
                           '',                //search type
                           '',                //eanAi
                           true);             //locked


    // Line Number
    AddConfHeaderTextValue(XmlCDataSection,
                            2,                 //id
                            'LineNumber',  //name
                            MobWmsLanguage.GetMessage('LINENUMBER') + ':',  //label
                            100,               //label width
                            false,             //clear on clear
                            false,             //accept barcode
                            20,                //length
                            false,             //optional
                            '',                //search type
                            '',                //eanAi
                            true);             //locked
end;
// << SendToPickRobot


The code above will add a new entry to Reference Data, identified by new Key "SendToPickRobotHeader".

...

Next, our new configuration header "SendToPickRobotHeader" needs to be associated with a new page in application.cfg. 

Modify the  the Mobile Configuration FileFiles


Code Block
titleapplication.cfg
<page id="SendToPickRobot" type="UnplannedItemRegistration" icon="">
	<title defaultValue="Send To Robot"/>
	<unplannedItemRegistrationConfiguration type="SendToPickRobotRegistrationType" useRegistrationCollector="false">
		<header configurationKey="SendToPickRobotHeader" automaticAcceptAfterLastScan="true"/>
	</unplannedItemRegistrationConfiguration>
</page>

...

<open id="SendToPickRobot" icon="" title="Send To Robot" />

Modify the  Mobile Configuration FileFiles


Code Block
titleapplication.cfg
   <page id="PickLines" type="OrderLines" icon="mainmenupick">
      <title defaultValue="@{PagePickOrderLinesTitle}"/>
      <orderLinesConfiguration>
        <service id="Pick"/>
        <list listId="OrderLinesWithImages"/>
        <viewRegistrations title="@{OrderLinesRegistrationMenuItem}" navigateTo="ViewRegistrations" enabled="true"/>
        <deleteOrderRegistrations title="@{OrderLinesDeleteAllOrderRegistrationsMenuItem}" enabled="true"/>
        <totePicking allowManualSelection="true">
          <currentTote show="true" useLabelPrefix="false"/>
        </totePicking>
        <scanToSelectBehaviour gs1SearchTerm="Item" behaviour="Auto"/>
      </orderLinesConfiguration>
      <actions>
        <showImage id="1" enabled="true" imageProperty="ItemImage" title="@{MenuItemShowImageTitle}"/>
		<open id="SendToPickRobot" icon="" title="Send To Robot" />
      </actions>
    </page>   

...