Use this event to
Determine the locations the user can use
Description
Mobile WMS 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 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:
- 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 Toolbox", 'OnBeforeGetLocationFilter', '', true, true)]
procedure 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') then begin
_LocationFilter := '*';
_IsHandled := true;
exit;
end;
if MobSessionData.GetMobileUserID() = 'JOHN' then begin
_LocationFilter := 'GREEN|BLUE';
_IsHandled := true;
exit;
end;
end;
See also
-
OnBeforeGetLocationFilter — Modify the locations the user can select and which locations the "All" filter includes
Version History
Version | Changes |
---|---|
MOB5.40 | Introduced |