OnBeforeGetLocationFilter
Use this event to
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:
- 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 Toolbox", 'OnBeforeGetLocationFilter', '', true, true)]
local 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 |