Versions Compared

Key

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

Use this event to

Excerpt

Handle Custom Registration Type for Adhoc PostRegistrationConfiguration Document Type.

Data from Xml Post-Request is provided as input parameter tables and be used/iterated with no use of Xml.

...

Template

...

          // Always return a response text to the front-end

          Status := 'OK';
          MOBToolbox.CreateSimpleResponse(_XMLResponseDoc, Status);

          // Return that this registration type was handled

          _IsHandled := true;

     end;
end;

Example

[EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnCustomRegistrationTypeAsXml''', true, true)]
local procedure OnPostAdhocRegistrationOnCustomRegistrationTypeAsXml(var _XMLRequestDoc: XmlDocumentvar _XMLResponseDoc: XmlDocument; _RegistrationType: Textvar _RegistrationTypeTracking: Text[200]; var _IsHandled: Boolean)
var
     MOBToolbox: Codeunit "MOB Toolbox";
     Status: Text;
begin
     if _RegistrationType = 'SetWhseClassCode' then begin
          if _IsHandled then
               exit;

...

procedure PostSetWhseClassCodeRegistration(_XMLRequestDoc: XmlDocumentvar _ReturnRegistrationTypeTracking: Text[200])Text[60];
var
     Item: Record Item;
     MobXMLMgt: Codeunit "MOB XML Management";
     MobToolbox: Codeunit "MOB Toolbox";
     MobWMSToolbox: Codeunit "MOB WMS Toolbox";
     MobWmsLanguage: Codeunit "MOB WMS Language";
     XMLRequestNode: XmlNode;
     XMLRequestDataNode: XmlNode;
     XMLParameterNode: XmlNode;
     XMLNodesList: XMLNodeList;
     ItemNumber: Code[20];
     i: Integer;
     WhseClassCode: Code[10];
begin
     // Extract any parameters from the XML
     // The parameters are located in the <requestData> element
     MobXMLMgt.GetDocRootNode(_XMLRequestDoc, XMLRequestNode);
     MobXMLMgt.FindNode(XMLRequestNode, MobWMSToolbox."CONST::requestData"(), XMLRequestDataNode);

...

Use this event to

Excerpt

Handle Custom Registration Type for Adhoc PostRegistrationConfiguration Document Type.

Data from Xml Post-Request is provided as input parameter tables and be used/iterated with no use of Xml.



Supersedes OnPostAdhocRegistrationOnCustomRegistrationTypeAsXml


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnCustomRegistrationType''', true, true)]
    local procedure OnPostAdhocRegistrationOnCustomRegistrationType(var _RequestElement: Record "MOB NS Request Element"; var _DraftRegistration: Record "MOB WMS Registration"; var _XMLRequestDoc: XmlDocumentvar _XMLResponseDoc: XmlDocument; _RegistrationType: Textvar _RegistrationTypeTracking: Text[200]; var _IsHandled: Boolean)
    begin
        if _RegistrationType = 'MyCustomRegistrationType' then begin      // Replace constant 'MyCustomRegistrationType' with your own RegistrationType
            if _IsHandled then
                exit;


            // Add Steps elements as Xml here
            // ....

            _IsHandled := true;
        end;
    end;



Example

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnCustomRegistrationType''', true, true)]
    local procedure MyOnPostAdhocRegistrationOnCustomRegistrationType(var _RequestElement: Record "MOB NS Request Element"; var _DraftRegistration: Record "MOB WMS Registration"; var _XMLRequestDoc: XmlDocumentvar _XMLResponseDoc: XmlDocument; _RegistrationType: Textvar _RegistrationTypeTracking: Text[200]; var _IsHandled: Boolean)
    begin
        if _RegistrationType = 'MyCustomRegistrationType' then begin      // Replace constant 'MyCustomRegistrationType' with your own RegistrationType
            if _IsHandled then
                exit;


            // Sample iteration of requestData (excluding <Order>-element)
            if _RequestElement.FindFirst() then
                repeat
                until _RequestElement.Next() 0;

            // Sample iteration of "draft" registrations from <Order>-element (snapshot of unposted Registrations as they look right now when an adhoc registration is triggered)
            // Draft registrations is included only if attribute sendRegistrationData="Order"|"OrderLine" was used from application.cfg
            if _DraftRegistration.FindFirst() then
                repeat
                until _DraftRegistration.Next() 0;

            // Add Steps elements as Xml here
            // ....

            _IsHandled := true;
        end;
    end;



Version History

Version

Changes

MOB5.15Introduced

...