Versions Compared

Key

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

Use this event to

Excerpt

Validate and save collected values to "MOB WMS Registration"-table.Determine the locations the user can use


Description

Mobile registrations form a planned function are stored in the "MOB WMS Registration"-tableWMS uses the Warehouse Employee table to determine which locations each Mobile User are allowed to use. This event allows changing this behavior to suit other requirements.

This event is first triggered in the GetReferenceData document type to generate the list of locations used in drop-down lists throughout the Mobile WMS application for each and every value received in the Mobile "Post request".the current user.

The event is next triggered each time the user sets the location filter to "All" on any page in Mobile WMS. This means the user might be presented with the options "BLUE, WHITE, All" in the drop-down list of a location filter, but when the user selects "All" it might instead find records from locations BLUE and GREEN.

You cannot change the sort order of the locations in the in the drop-down list. It is always the location marked as default in the warehouse employee table that is shown first followed by the additional locations sorted alphabetically.


You can use this event to:

...

  • avoiding validation errors 

...

  • throw meaningful error message, rather than error messages received from standard posting functions

...

Tip

Saving custom values in MOB WMS Registration -to save data to posting routines is not required since version 5.10

You can read custom values from directly via .GetValue(...)-Event Subscriber where you've got access to the MOB WMS Registration-table.

Template

...

  • Allow users to select other locations than configured in the warehouse employee table
  • Allow the location filter "All" to include a different set of locations than shown in the drop-down list


Tip

The MobDataSession codeunit can be used to retrieve request info to differentiate _LocationFilter based on user and/or document type.

The _LocationFilter is used as a base filter and there might be additional requirements (e.g. Location."Require Shipment" = true) before the location is used in a given situation.


Template

    [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOB WMS ToolboxMOB WMS Toolbox",  'OnSaveRegistrationValueOnBeforeGetLocationFilter',  '',  truetrue,  truetrue)]
        procedure OnSaveRegistrationValue(_Path: Text; _Value: Textvar _MobileWMSRegistration: Record "MOB WMS Registration"; var _IsHandled: Boolean)
    begin
    end;

...

OnBeforeGetLocationFilter(var _LocationFilter: Text; var _IsHandled: Boolean)
    begin
    end;


Example

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Toolbox", 'OnBeforeGetLocationFilter', '', true, true)]
    procedure Ex01OnBeforeGetLocationFilter(var _LocationFilter: Text; var _IsHandled: Boolean)
    var
        MobSessionData: Codeunit"MOB SessionData";
    begin
        if (MobSessionData.GetDocumentType() = 'Lookup') and (MobSessionData.GetRegistrationType() = 'LocateItem') thenbegin
            _LocationFilter := '*';
            _IsHandled := true;
            exit;
        end;
        if MobSessionData.GetMobileUserID() = 'JOHN'thenbegin
            _LocationFilter := 'GREEN|BLUE';
            _IsHandled := true;
            exit;
        end;
    end;


See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
excerptTypesimple
cqllabel = "bc" and label = "onbeforegetlocationfilter" and label = "example"

...