Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Use this event to

Excerpt

Populate new line when adding to an Item Journal (location without "Directed Put-away and Pick")

See also: OnPostAdhocRegistrationOnAddCountLine_OnAfterCreateWhseJnlLine

...

Run additional code after a PostAdhocRegistration request has been executed.


Template

    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnAddCountLineOnPostAdhocRegistration_OnAfterCreateItemJnlLineOnAfterPost''', true, true)]
    local procedure OnPostAdhocRegistrationOnAddCountLine OnPostAdhocRegistration_OnAfterCreateItemJnlLine(OnAfterPost(_MessageId: Guid; _RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _ItemJnlLineXmlResponseDocRecord "Item Journal Line"XmlDocumentvar _RegistrationTypeTracking: Text)
    begin
    end;

Example

    // [Example] 
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnAddCountLineOnPostAdhocRegistration_OnAfterCreateItemJnlLineOnAfterPost''', true, true)]
    local procedure MyOnPostAdhocRegistrationOnAddCountLine MyOnPostAdhocRegistration_OnAfterCreateItemJnlLine(OnAfterPost(_MessageId: Guid; _RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _ItemJnlLineXmlResponseDoc: Record "Item Journal Line" XmlDocumentvar _RegistrationTypeTracking: Text)
    var
        RegistrationType        MobSetupTextRecord "MOB Setup";
        ItemNo        MobWmsToolboxText;
        LocationCode: Text;
        BinCode: Text;
    begin
        RegistrationType := _RequestValues.GetValue('RegistrationType');        ItemNo := _RequestValues.GetValue('AddCountLineItem');
        LocationCode := _RequestValues.GetValue('Location');
        BinCode := _RequestValues.GetValue('Bin');
        _ItemJnlLine.Validate(Description, CopyStr(StrSubstNo('%1 %2 at %3 %4', RegistrationType, ItemNo, LocationCode, BinCode)1, MaxStrLen(_ItemJnlLine.Description)));
    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)]
    localprocedure 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;


Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
titleMore examples
excerptTypesimple
cqllabel = "bc" and label = "example" and label = "OnPostAdhocRegistrationOnAddCountLine_OnAfterCreateItemJnlLineadhoc" and label = "onafterpost"


Version History

Version

Changes

MOB5.
17
27Introduced