OnPostAdhocRegistration_OnAfterPost

Use this event to

Run additional code after a PostAdhocRegistration request has been executed.

Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistration_OnAfterPost''', true, true)]
    local procedure OnPostAdhocRegistration_OnAfterPost(_MessageId: Guid; _RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _XmlResponseDoc: XmlDocumentvar _RegistrationTypeTracking: Text)
    begin
    end;

Example

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistration_OnAfterPost''', true, true)]
    local procedure MyOnPostAdhocRegistration_OnAfterPost(_MessageId: Guid; _RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _XmlResponseDoc: XmlDocumentvar _RegistrationTypeTracking: Text)
    var
        MobSetup: Record "MOB Setup";
        MobWmsToolbox: Codeunit "MOB WMS Toolbox";
    begin
        if _RegistrationType <> MobWmsToolbox."CONST::UnplannedCount"() then
            exit;

        MobSetup.Get();
        if MobSetup."Skip Whse Unpl Count IJ Post" then begin
            // Some code to calculate item journal adjustment using the "Calculate Whse. Adjustment" report
            // ...

            _RegistrationTypeTracking := _RegistrationTypeTracking + ' / Item Journal adjustment calculated';
        end;
    end;

Example 2

// Overwrite Sucess message to show after posting of Unplanned Move

[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistration_OnAfterPost', '', true, true)]
    local procedure Ex02OnPostAdhocRegistration_OnAfterPost(_MessageId: Guid; _RegistrationType: Text; var _RequestValues: Record "MOB NS Request Element"; var _XmlResponseDoc: XmlDocument; var _RegistrationTypeTracking: Text)
    var
        MobWmsToolbox: Codeunit "MOB WMS Toolbox";
        MobToolbox: Codeunit "MOB Toolbox";
        SuccessMessage: Text;
    begin
        if _RegistrationType <> MobWmsToolbox."CONST::UnplannedMove"() then
            exit;


        SuccessMessage := StrSubstNo('My Custom Sucess Message for UnPlannedMove: Qty: %1 Item: %2 To-bin: %3', _RequestValues.Get_Quantity(), _RequestValues.Get_ItemNumber(), _RequestValues.Get_ToBin());
        MobToolbox.CreateSimpleResponse(_XmlResponseDoc, SuccessMessage);
    end;


More examples

There are no items with the selected labels at this time.


Version History

Version

Changes

MOB5.27Introduced