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")

...

Run additional code after a PostAdhocRegistration request has been executed.


Template

    // [Template]
        [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnAddCountLine_OnAfterCreateItemJnlLineOnAfterPostAdhocRegistration''', true, true)]
    local procedure OnPostAdhocRegistrationOnAddCountLine_OnAfterCreateItemJnlLine( OnAfterPostAdhocRegistration(_MessageId: Guid; _RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _ItemJnlLineRegistrationTypeTrackingRecord "Item Journal Line"Text)
    begin
    end;

Example

    // [Example] 
    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistrationOnAddCountLine_OnAfterCreateItemJnlLineOnAfterPostAdhocRegistration''', true, true)]
    local procedure MyOnPostAdhocRegistrationOnAddCountLine_OnAfterCreateItemJnlLine( MyOnAfterPostAdhocRegistration(_MessageId: Guid; _RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _ItemJnlLineRegistrationTypeTrackingRecord "Item Journal Line"Text)
    var
        RegistrationType        MobSetupText;
        ItemNo: TextRecord "MOB Setup";
        LocationCode        MobWmsToolboxText;
        BinCode: TextCodeunit "MOB WMS Toolbox";
    begin
        RegistrationType :=        if _RequestValues.GetValue('RegistrationType')RegistrationType <> MobWmsToolbox."CONST::UnplannedCount"() then
            exit;

        ItemNo := _RequestValues.GetValue('AddCountLineItem'MobSetup.Get();
        LocationCode := _RequestValues.GetValue('Location');
        BinCode        if MobSetup."Skip Whse Unpl Count IJ Post" then begin
            // Some code to calculate item journal adjustment using the "Calculate Whse. Adjustment" report
            // ...
        end;

        _RegistrationTypeTracking := _RequestValues.GetValue('Bin');
        _ItemJnlLine.Validate(Description, CopyStr(StrSubstNo('%1 %2 at %3 %4', RegistrationType, ItemNo, LocationCode, BinCode)1, MaxStrLen(_ItemJnlLine.Description)));
RegistrationTypeTracking + ' / Item Journal adjustment calculated';
    end;



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


Version History

Version

Changes

MOB5.1727Introduced