MobileNavigator220FDW
High-level navigation helper that builds navigation commands with proper page resolution, navigation data, and state serialization in a single call.
Overview
- Object type: Codeunit
- Object ID: 73167898
- Access: Public
- Namespace:
Aptean.Mesh.SDUI
The navigator provides convenience methods that combine page code resolution, navigation data assembly, and command building into one call. It uses the MobilePage220FDW enum to identify targets and resolves page codes via the OnResolveTarget integration event.
var
Navigator: Codeunit MobileNavigator220FDW;
begin
// Navigate to a receipt detail screen
exit(Navigator.NavigateToDetail(State, MobilePage220FDW::Receipt, 'WH-REC-001'));
end;
Unlike MobileCommandBuilder220FDW which buffers commands for later serialization, the navigator methods call State.Serialize() internally and return the final response JsonObject directly.
MobilePage220FDW Enum
The MobilePage220FDW enum identifies mobile page targets. It is extensible, so custom pages can be added by extension apps.
| Value | Caption | Description |
|---|---|---|
Home | Home | The main home/dashboard screen |
Detail | Detail | Document detail view |
Receipt | Receipt | Warehouse receipt workflow |
PutAway | Put Away | Put-away workflow |
Pick | Pick | Pick workflow |
InventoryMovement | Inventory Movement | Inventory movement workflow |
AdHocMovement | Ad-Hoc Movement | Ad-hoc movement workflow |
BinContents | BinContents | Bin contents inquiry |
Adjustments | Adjustments | Inventory adjustments |
ScanEntry | ScanEntry | Generic scan entry screen |
Navigation Methods
NavigateToDetail
procedure NavigateToDetail(var State: Codeunit MobileRPCState220FDW; Target: Enum MobilePage220FDW; DocumentNo: Code[20]): JsonObject
Navigates to a document detail screen. Resolves the page code via OnResolveTarget, builds navigation data including the document number, title, and type, then serializes the response.
Parameters:
| Name | Type | Description |
|---|---|---|
State | Codeunit MobileRPCState220FDW | The RPC state (passed by reference) |
Target | Enum MobilePage220FDW | The target page type |
DocumentNo | Code[20] | The document number to display |
Returns: JsonObject -- the serialized RPC response.
The navigation data payload includes:
| Key | Description |
|---|---|
documentNo | The document number |
documentTitle | Resolved title (defaults to "<Target> <DocumentNo>") |
documentType | Resolved type text (defaults to Format(Target)) |
Example:
local procedure HandleDocumentTap(var State: Codeunit MobileRPCState220FDW): JsonObject
var
Navigator: Codeunit MobileNavigator220FDW;
DocumentNo: Code[20];
begin
DocumentNo := State.GetInput('documentNo', true);
exit(Navigator.NavigateToDetail(State, MobilePage220FDW::Receipt, DocumentNo));
end;
NavigateToWorkflow
procedure NavigateToWorkflow(var State: Codeunit MobileRPCState220FDW; Target: Enum MobilePage220FDW; DocumentNo: Code[20]; LineNo: Integer): JsonObject
Navigates to a workflow screen for a specific document line. Resolves the page code and builds navigation data with document number and line number.
Parameters:
| Name | Type | Description |
|---|---|---|
State | Codeunit MobileRPCState220FDW | The RPC state (passed by reference) |
Target | Enum MobilePage220FDW | The target page type |
DocumentNo | Code[20] | The document number |
LineNo | Integer | The line number to work on |
Returns: JsonObject -- the serialized RPC response.
NavigateToWorkflow (with UOM)
procedure NavigateToWorkflow(var State: Codeunit MobileRPCState220FDW; Target: Enum MobilePage220FDW; DocumentNo: Code[20]; LineNo: Integer; SelectedUOM: Code[10]): JsonObject
Navigates to a workflow screen with a pre-selected unit of measure.
Parameters:
| Name | Type | Description |
|---|---|---|
State | Codeunit MobileRPCState220FDW | The RPC state (passed by reference) |
Target | Enum MobilePage220FDW | The target page type |
DocumentNo | Code[20] | The document number |
LineNo | Integer | The line number to work on |
SelectedUOM | Code[10] | The pre-selected unit of measure |
Returns: JsonObject -- the serialized RPC response.
Example:
local procedure StartReceiptWorkflow(var State: Codeunit MobileRPCState220FDW): JsonObject
var
Navigator: Codeunit MobileNavigator220FDW;
begin
exit(Navigator.NavigateToWorkflow(
State,
MobilePage220FDW::Receipt,
'WH-REC-001',
10000,
'PCS'));
end;
NavigateHome
procedure NavigateHome(var State: Codeunit MobileRPCState220FDW): JsonObject
Navigates to the home screen.
Parameters:
| Name | Type | Description |
|---|---|---|
State | Codeunit MobileRPCState220FDW | The RPC state (passed by reference) |
Returns: JsonObject -- the serialized RPC response.
NavBackToHomeWithAlert
procedure NavBackToHomeWithAlert(var State: Codeunit MobileRPCState220FDW; Title: Text; Message: Text): JsonObject
Pops the navigation stack back to the home screen and shows an alert dialog. Use this after completing a workflow to return the user to home with a success message.
Parameters:
| Name | Type | Description |
|---|---|---|
State | Codeunit MobileRPCState220FDW | The RPC state (passed by reference) |
Title | Text | Alert dialog title |
Message | Text | Alert dialog message |
Returns: JsonObject -- the serialized RPC response.
Example:
local procedure CompleteReceipt(var State: Codeunit MobileRPCState220FDW): JsonObject
var
Navigator: Codeunit MobileNavigator220FDW;
begin
// Post the receipt...
PostWarehouseReceipt(State.GetDocumentNo(true));
exit(Navigator.NavBackToHomeWithAlert(
State,
'Receipt Posted',
'Warehouse receipt WH-REC-001 has been posted successfully.'));
end;
Helper Methods
GetPageCode
procedure GetPageCode(Page: Enum MobilePage220FDW): Code[20]
Converts a MobilePage220FDW enum value to its uppercase page code string. For example, MobilePage220FDW::Receipt returns 'RECEIPT'.
Parameters:
| Name | Type | Description |
|---|---|---|
Page | Enum MobilePage220FDW | The page enum value |
Returns: Code[20] -- the uppercase page code.
GetMobilePage
procedure GetMobilePage(DocumentTypeText: Text): Enum MobilePage220FDW
Converts a document type text string back to a MobilePage220FDW enum value. Returns Home if no match is found.
Parameters:
| Name | Type | Description |
|---|---|---|
DocumentTypeText | Text | The document type text to look up |
Returns: Enum MobilePage220FDW
BuildWorkflowNavigationData
procedure BuildWorkflowNavigationData(var State: Codeunit MobileRPCState220FDW; DocumentNo: Code[20]; LineNo: Integer): JsonObject
Builds the navigation data JSON for a workflow screen containing the document number and line number.
Parameters:
| Name | Type | Description |
|---|---|---|
State | Codeunit MobileRPCState220FDW | The RPC state (for key name resolution) |
DocumentNo | Code[20] | The document number |
LineNo | Integer | The line number |
Returns: JsonObject -- navigation data with documentNo and lineNo keys.
BuildWorkflowNavigationData (with UOM)
procedure BuildWorkflowNavigationData(var State: Codeunit MobileRPCState220FDW; DocumentNo: Code[20]; LineNo: Integer; SelectedUOM: Code[10]): JsonObject
Builds workflow navigation data including a pre-selected unit of measure.
Parameters:
| Name | Type | Description |
|---|---|---|
State | Codeunit MobileRPCState220FDW | The RPC state (for key name resolution) |
DocumentNo | Code[20] | The document number |
LineNo | Integer | The line number |
SelectedUOM | Code[10] | The pre-selected UOM (omitted from JSON if empty) |
Returns: JsonObject
OnResolveTarget Integration Event
[IntegrationEvent(false, false)]
local procedure OnResolveTarget(Target: Enum MobilePage220FDW; DocumentNo: Code[20]; var PageCode: Code[20]; var Title: Text; var TypeText: Text; var Handled: Boolean)
This integration event fires when the navigator resolves a target page. Subscribe to it to customize page codes, titles, or type text for specific document types.
Event parameters:
| Name | Type | Direction | Description |
|---|---|---|---|
Target | Enum MobilePage220FDW | In | The requested target page |
DocumentNo | Code[20] | In | The document number |
PageCode | Code[20] | Out | Set this to override the page code |
Title | Text | Out | Set this to override the navigation title |
TypeText | Text | Out | Set this to override the document type text |
Handled | Boolean | Out | Set to true to indicate the event was handled |
Subscriber example:
[EventSubscriber(ObjectType::Codeunit, Codeunit::MobileNavigator220FDW,
'OnResolveTarget', '', false, false)]
local procedure OnResolveTarget(
Target: Enum MobilePage220FDW;
DocumentNo: Code[20];
var PageCode: Code[20];
var Title: Text;
var TypeText: Text;
var Handled: Boolean)
var
WhseRecHeader: Record "Warehouse Receipt Header";
begin
if Target <> MobilePage220FDW::Receipt then
exit;
if WhseRecHeader.Get(DocumentNo) then begin
PageCode := 'RECEIPT';
Title := StrSubstNo('Receipt %1 - %2', DocumentNo, WhseRecHeader."Vendor No.");
TypeText := 'Receipt';
Handled := true;
end;
end;
When Handled is false, the navigator falls back to default resolution:
PageCodeis derived fromGetPageCode(Target)(uppercase enum caption)Titleis set to"<Target> <DocumentNo>"TypeTextis set toFormat(Target)
See Also
- MobileRPCState220FDW -- the state object used by navigator methods
- MobileCommandBuilder220FDW -- low-level command building (used internally by the navigator)
- Enums --
MobilePage220FDWenum values