MobileOptionsProvider220FDW
Codeunit 73167914 — Manages the translated option values for filter dropdowns on the Home page. Exposes an integration event that lets you add custom options to any built-in filter type without modifying the platform.
OnRegisterFilterOptions
[IntegrationEvent(false, false)]
procedure OnRegisterFilterOptions(FilterType: Code[20]; var Options: JsonArray)
Subscribe to this event to inject additional options into any filter. Each option is a JsonObject with two keys:
| Key | Type | Description |
|---|---|---|
label | Text | Display text — use a Label variable so BC translates it via XLIFF |
value | Text | API token — use a Locked Label so it never changes |
Example — adding a custom document type:
[EventSubscriber(ObjectType::Codeunit, Codeunit::MobileOptionsProvider220FDW, OnRegisterFilterOptions, '', false, false)]
local procedure AddMyDocType(FilterType: Code[20]; var Options: JsonArray)
var
OptionsProvider: Codeunit MobileOptionsProvider220FDW;
OptionObj: JsonObject;
MyDocTypeLbl: Label 'Transfer Order';
MyDocTypeTok: Label 'TransferOrder', Locked = true;
begin
if FilterType <> OptionsProvider.FilterTypeDocType() then exit;
OptionObj.Add('label', MyDocTypeLbl);
OptionObj.Add('value', MyDocTypeTok);
Options.Add(OptionObj);
end;
If you want the label translated in the mobile client's string map, also subscribe to MobileClientStrings220FDW.OnRegisterExtensionStrings and add the same label there so the #token replacement picks it up.
FilterType Constants
Use these methods to get the correct FilterType code when checking inside OnRegisterFilterOptions:
| Method | Returns | Built-in options |
|---|---|---|
FilterTypeType() | 'Type' | Inbound, Internal, Outbound |
FilterTypeAssignment() | 'Assignment' | Assigned to Me, Unassigned, All |
FilterTypeDocType() | 'DocType' | Receipt, Put-Away, Pick, Movement |
FilterTypeDateRange() | 'DateRange' | All, Today |
Built-in Option Tokens
These are the value tokens the platform already registers. Your AL service code receives the selected token via State.GetInput('filterDocType', false) (or the relevant filter key) and should match against these:
| Filter | Token | Display label |
|---|---|---|
| Type | 'Inbound' | Inbound |
| Type | 'Internal' | Internal |
| Type | 'Outbound' | Outbound |
| Assignment | 'Assigned to Me' | Assigned to Me |
| Assignment | 'Unassigned' | Unassigned |
| Assignment | 'All' | All |
| DocType | 'Receipt' | Receipt |
| DocType | 'PutAway' | Put-Away |
| DocType | 'Pick' | Pick |
| DocType | 'Movement' | Movement |
| DateRange | 'All' | All |
| DateRange | 'Today' | Today |