Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...


Info
titleRequirement

Android App version 1.5.7

Use this event to

Excerpt

Interrupt posting process to create addtional collect additonal steps - based on already collected values.

...

Description

...

Description

The posting process can be interrupted and new steps returned to the mobile device in order to collect additional information.

The Adhoc posting request is automatically executed again once such new steps have been collected, and will include the newly collected values for those steps as well.


Collecting additonal values from new steps (created using this event) must go hand-in-hand with addtional customizations to handle such values:

Handle collected values for your own custom Adhoc Registration Types

  • When extending your own custom adhoc Registration Types you can handle all collected values in your inline code.

...

Custom Registration Type

Standard Registration Type

  • When extending standard Mobile WMS adhoc registration types, usually values can be handled in 'OnAfterCreateItemJnlLine' or 'OnAfterCreateWhseJnlLine' events assiciated with the Registration Type (i.e. OnPostAdhocRegistrationOnUnplannedCount_OnAfterCreateItemJnlLine).
  • In some cases your required changes to standard adhoc posting functions may not be supported by existing events, including when errors are triggered in the standard Mobile WMS code prior to events being fired. In In such cases the relevant PostXXX-function from 'Mobile WMS Adhoc Registr.' may be need to be cloned to a new custom Registration Type to be able handle your values.
      However, cloning
      • Cloning code should be avoided whenever possible. You are always welcome to raise a support ticket to request new events for standard Mobile WMS to help your customization needs.


    See also: Return steps on Post

    ...

        // [Template]
        [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistration_OnAddSteps''', true, true)]
        local procedure OnPostAdhocRegistration_OnAddSteps(_RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text)
        begin
        end;

    Example

    Workflow for customization example below:

    ...

        [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistration_OnAddSteps''', true, true)]
        local procedure MyOnPostAdhocRegistration_OnAddSteps(_RegistrationType: Textvar _RequestValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text)
        var
            Location: Record Location;
            ItemTrackingMgt: Codeunit "Item Tracking Management";
            MobWmsAdhocReg: Codeunit "MOB WMS Adhoc Registr.";
            MobWmsToolbox: Codeunit "MOB WMS Toolbox";
            ItemNumber: Code[20];
            VariantCode: Code[20];
            LocationCode: Code[10];
            LotNo: Code[50];
            SerialNo: Code[50];
            RegisterSerialNumber: Boolean;
            RegisterLotNumber: Boolean;
            RegisterExpirationDate: Boolean;
            ExistingExpirationDate: Date;
            EntriesExist: Boolean;
        begin
            if _RegistrationType <> MobWmsToolbox."CONST::UnplannedCount"() then
                exit;

            if _RequestValues.HasValue('ExpirationDate'then
                exit;   // already collected, break to avoid adding the same new step indefinitely

            ItemNumber := _RequestValues.GetValue('Item', true);        // mandatory
            VariantCode := _RequestValues.GetValue('Variant', false);   // optional, only exists if item has associated variants
            LocationCode := _RequestValues.GetValue('Location', true);  // mandatory
            LotNo := _RequestValues.GetValue('LotNumber', false);       // optional, only used if RegisterExpirationDate is true
            SerialNo := _RequestValues.GetValue('SerialNumber', false)// optional, only used if RegisterExpirationDate is true

            MobWmsAdhocReg.DetermineNegAdjustItemTracking(ItemNumber, RegisterSerialNumber, RegisterLotNumber, RegisterExpirationDate);
            if not RegisterExpirationDate then
                exit;   // ItemTrackingCode."Man. Expir. Date Entry Reqd." = false

            // ExpirationDate is needed: Verify if an existing ExpirationDate can be derived from existing entries
            // The 'GetWhseExpirationDate' function used below will return if any entries exists for the lot number EVEN if such entries all has a blank expiration date or is closed
            Location.Get(LocationCode);
            EntriesExist := ItemTrackingMgt.GetWhseExpirationDate(
                ItemNumber,
                VariantCode,
                Location,
                LotNo,
                SerialNo,
                ExistingExpirationDate);

            if (ExistingExpirationDate <> 0D) or EntriesExist then
                exit;   // same break condition as 'GetWhseExpirationDate' used in standard posting code

            // Add the new 'ExpirationDate'-step
            _Steps.Create_DateStep_ExpirationDate(50000, ItemNumber);

            //
            // Additional changes:
            // 
            // Currently no events in codeunit "MOB WMS Adhoc Registr.".PostUnplannedCountRegistration() supports suppressing the error message concerning a missing expiration date
            // on entries when the journal line is created. In this case we will need to clone the code from 'PostUnplannedCountRegistration()' to a new adhoc RegistrationType and do
            // our changes to 'PostUnplannedCountRegistration()' in a copy of the code.
            //
            // However, cloning code should be avoided whenever possible. You are always welcome to raise a support ticket to have new events included in standard Mobile WMS to help
            // your customization needs.
            //
            // In most cases you should be able to use events:
            // * OnPostAdhocRegistrationOnXXX_OnAfterCreateWhseJnlLine(_RequestValues, TempWhseJnlLine)   or
            // * OnPostAdhocRegistrationOnXXX_OnAfterCreateItemJnlLine(_RequestValues, TempItemJnlLine)
            //
        end;



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

    ...