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 10 Next »

Use this event to

Handle business logic for the custom RegistrationType.

Data from Xml Post-Request is provided as input parameter tables and be accessed/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
  • No labels