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 Typebusiness logic for the custom RegistrationType.

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

...

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

...