Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »


Add new ListData (DataTable) to ReferenceData.  ListData (DataTables) elements is every element not named <Configuration>. 

Input is XmlReponse with standard Mobile WMS' ListData already written to the Xml.  Addtional elements can be added directly to the response.


Template:

[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAfterAddListDataAsXml', '', true, true)]
procedure OnGetReferenceData_OnAfterAddListDataAsXml(var _XmlResponseData: XmlNode)
begin
     // Add ListData (DataTable) here...
end;

Example:

[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAfterAddListDataAsXml', '', true, true)]
procedure OnGetReferenceData_OnAfterAddListDataAsXml(var _XmlResponseData: XmlNode)
begin
     AddShipmentMethods(_XmlResponseData);
end;


local procedure AddShipmentMethods(var XMLResponseData: XmlNode);
var
     ShipmentMethod: Record "Shipment Method";
     MobXmlMgt: Codeunit "MOB XML Management";
     XmlCreatedNode: XmlNode;
     XmlShipmentMethodNode: XmlNode;
     SHIPMENT_METHOD_TABLE_Txt: Label 'ShipmentMethod', Locked = true;
begin
     // Add all shipment method codes
     ShipmentMethod.SetFilter(Code, '<>%1', '');
     if ShipmentMethod.FindSet() then
     repeat
          // Add the <ShipmentMethod> element
          MobXMLMgt.AddElement(XMLResponseData, SHIPMENT_METHOD_TABLE_Txt, '', '', XmlShipmentMethodNode);


          // Add the <Code> element
          MobXMLMgt.AddElement(XmlShipmentMethodNode, 'Code', ShipmentMethod.Code, '', XmlCreatedNode);

     until ShipmentMethod.Next() = 0;
end;

Version History:

VersionChanges
MOB5.00Introduced
  • No labels