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.

Description

Mobile registrations form a planned function are stored in the "MOB WMS Registration"-table.

...

Modify the locations the user can select and which locations the "All" filter includes


Description

The Warehouse Employee table is used to determine which locations each Mobile User are allowed to use.

This event is first triggered in the GetReferenceData document type to generate the list of locations used in drop-down lists throughout the current login.

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.

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.

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

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

Template

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Toolbox", 'OnBeforeGetLocationFilter', '', true, true)]
    local procedure OnBeforeGetLocationFilter(var _LocationFilter: Text; var _IsHandled: Boolean)
    begin
    end;

Example

    [EventSubscriber(ObjectType::Codeunit,  Codeunit::"MOB WMS ToolboxMOB WMS Toolbox",  'OnSaveRegistrationValueOnBeforeGetLocationFilter',  '',  truetrue,  truetrue)]
        local procedure OnSaveRegistrationValue Ex01OnBeforeGetLocationFilter(var _PathLocationFilter:  Text;  var _ValueIsHandled: Boolean)
  Text;   var
    _MobileWMSRegistration:   Record   MobSessionData: Codeunit"MOB WMS RegistrationMOB SessionData"; var
    begin
        if (MobSessionData.GetDocumentType() = 'Lookup') and (MobSessionData.GetRegistrationType() = 'LocateItem') thenbegin
            _LocationFilter := '*';
            _IsHandled : Boolean)
    begin
    end;

...

= true;
            exit;
        end;
        if MobSessionData.GetMobileUserID() = 'JOHN'thenbegin
            _LocationFilter := 'GREEN|BLUE';
            _IsHandled := true;
            exit;
        end;
    end;


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

 

Version History

VersionChanges
MOB5.1140Introduced