Use this event to
Excerpt |
---|
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. |
...
Template
[EventSubscriber(ObjectType::Codeunit, Codeunit::"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: XmlDocument; var _XMLResponseDoc: XmlDocument; _RegistrationType: Text; var _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::Codeunit, Codeunit::"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: XmlDocument; var _XMLResponseDoc: XmlDocument; _RegistrationType: Text; var _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.15 | Introduced |
...