MobileWorkflowBuilder220FDW
Builder for constructing step input JSON that configures scan, choice, and summary screens in Aptean Mesh mobile workflows.
Overview
- Object type: Codeunit
- Object ID: 73167879
- Access: Public
- Namespace:
Aptean.Mesh.SDUI
The workflow builder produces the scanInput payload that tells the mobile app what kind of input to prompt the user for next. It supports three input modes:
| Mode | Description | Builder entry point |
|---|---|---|
| Scan Input | Barcode scanner, text field, numeric keypad, date picker | Configure() |
| Choice | Selection list with options | BeginChoice() + AddChoice() |
| Summary | Review/confirmation screen with key-value pairs | BeginSummary() + AddSummaryItem() |
The builder uses a fluent API and is accessed through State.StepInput() on the MobileRPCState220FDW object. It is automatically flushed when State.Serialize() is called.
// Configure a barcode scan step
State.StepInput().Configure(
StepInputType220FDW::Barcode,
'scanItem',
'Scan Item',
'Scan the item barcode');
exit(State.Serialize());
You do not need to instantiate MobileWorkflowBuilder220FDW directly. Access it through State.StepInput() on the MobileRPCState220FDW object.
StepInputType220FDW Enum
The StepInputType220FDW enum determines the type of input control shown on the mobile device.
| Value | Caption | Hardware Scan | Description |
|---|---|---|---|
Barcode | Barcode | Yes | Barcode scanner with camera/hardware scan support |
Text | Text | Yes | Free-form text input |
Numeric | Numeric | Yes | Numeric keypad |
DatePicker | DatePicker | No | Date selection calendar |
Image | Image | No | Image capture |
Choice | Choice | No | Selection from a list of options |
StatusInfo | StatusInfo | No | Status information display |
Summary | Summary | No | Review/confirmation screen |
The Hardware Scan column indicates whether the input type accepts input from a hardware barcode scanner (e.g., Zebra devices). Barcode, Text, and Numeric types accept hardware scans.
Scan Input Configuration
Configure (from workflow step record)
procedure Configure(WorkflowStep: Record "Mobile Workflow Step 220FDW"): Codeunit MobileWorkflowBuilder220FDW
Configures step input from a workflow step configuration record. The step type, label, and instruction are read from the record automatically.
Parameters:
| Name | Type | Description |
|---|---|---|
WorkflowStep | Record "Mobile Workflow Step 220FDW" | The workflow step configuration record |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
Configure (with type, id, label, prompt)
procedure Configure(InputType: Enum StepInputType220FDW; StepId: Text; StepLabel: Text; Prompt: Text): Codeunit MobileWorkflowBuilder220FDW
Configures step input with explicit parameters.
Parameters:
| Name | Type | Description |
|---|---|---|
InputType | Enum StepInputType220FDW | The type of input control |
StepId | Text | Unique identifier for this step |
StepLabel | Text | Label displayed on the input control |
Prompt | Text | Instruction text for the user |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
Example:
State.StepInput().Configure(
StepInputType220FDW::Barcode,
'scanItem',
'Scan Item',
'Scan the item barcode or enter it manually');
Configure (with default value)
procedure Configure(InputType: Enum StepInputType220FDW; StepId: Text; StepLabel: Text; Prompt: Text; DefaultValue: Text): Codeunit MobileWorkflowBuilder220FDW
Configures step input with a pre-filled default value. The user sees this value already entered and can accept or override it.
Parameters:
| Name | Type | Description |
|---|---|---|
InputType | Enum StepInputType220FDW | The type of input control |
StepId | Text | Unique identifier for this step |
StepLabel | Text | Label displayed on the input control |
Prompt | Text | Instruction text for the user |
DefaultValue | Text | Pre-filled value |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
Example:
// Pre-fill quantity with the remaining amount
State.StepInput().Configure(
StepInputType220FDW::Numeric,
'enterQty',
'Enter Quantity',
'Enter the quantity to receive',
Format(RemainingQty));
ConfigureWithSuggestions
procedure ConfigureWithSuggestions(InputType: Enum StepInputType220FDW; StepId: Text; StepLabel: Text; Prompt: Text; DefaultValue: Text; SuggestValues: List of [Text]): Codeunit MobileWorkflowBuilder220FDW
Configures step input with a side pane showing suggested values. The user can select a suggestion or enter a value manually.
Parameters:
| Name | Type | Description |
|---|---|---|
InputType | Enum StepInputType220FDW | The type of input control |
StepId | Text | Unique identifier for this step |
StepLabel | Text | Label displayed on the input control |
Prompt | Text | Instruction text for the user |
DefaultValue | Text | Pre-filled value |
SuggestValues | List of [Text] | List of suggested values shown in the side pane |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
Example:
var
BinSuggestions: List of [Text];
begin
BinSuggestions.Add('BIN-A01');
BinSuggestions.Add('BIN-A02');
BinSuggestions.Add('BIN-B01');
State.StepInput().ConfigureWithSuggestions(
StepInputType220FDW::Barcode,
'scanBin',
'Scan Bin',
'Scan the destination bin',
'BIN-A01',
BinSuggestions);
end;
ConfigureWithSuggestionsAndSelected
procedure ConfigureWithSuggestionsAndSelected(InputType: Enum StepInputType220FDW; StepId: Text; StepLabel: Text; Prompt: Text; DefaultValue: Text; SuggestValues: List of [Text]; SelectedValue: Text): Codeunit MobileWorkflowBuilder220FDW
Configures step input with suggestions and a pre-selected value. The side pane shows radio-button selection with the specified value already selected.
Parameters:
| Name | Type | Description |
|---|---|---|
InputType | Enum StepInputType220FDW | The type of input control |
StepId | Text | Unique identifier for this step |
StepLabel | Text | Label displayed on the input control |
Prompt | Text | Instruction text for the user |
DefaultValue | Text | Pre-filled value in the input field |
SuggestValues | List of [Text] | List of suggested values shown in the side pane |
SelectedValue | Text | The value to pre-select in the side pane (radio button) |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
Choice Input
Use the choice mode to present the user with a list of options to select from.
BeginChoice
procedure BeginChoice(ChoiceLabel: Text; ChoicePrompt: Text): Codeunit MobileWorkflowBuilder220FDW
Starts building a choice selection input. Call AddChoice() for each option, then let State.Serialize() finalize the output.
Parameters:
| Name | Type | Description |
|---|---|---|
ChoiceLabel | Text | Label for the choice screen |
ChoicePrompt | Text | Instruction text |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
AddChoice
procedure AddChoice(ChoiceKey: Text; ChoiceLabel: Text; ChoiceDescription: Text; ChoiceIcon: Text): Codeunit MobileWorkflowBuilder220FDW
Adds a choice option. Pass an empty string for ChoiceDescription or ChoiceIcon if not needed.
Parameters:
| Name | Type | Description |
|---|---|---|
ChoiceKey | Text | Unique key returned when this option is selected |
ChoiceLabel | Text | Display label for the option |
ChoiceDescription | Text | Optional description text (pass '' to omit) |
ChoiceIcon | Text | Optional Material icon name (pass '' to omit) |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
Example:
State.StepInput()
.BeginChoice('Select Action', 'What would you like to do?')
.AddChoice('receive', 'Receive', 'Receive items into warehouse', 'inbox')
.AddChoice('putaway', 'Put Away', 'Move items to storage bins', 'move_to_inbox')
.AddChoice('pick', 'Pick', 'Pick items for shipment', 'outbox');
exit(State.Serialize());
Summary Input
Use summary mode to show a review/confirmation screen before finalizing an operation.
BeginSummary
procedure BeginSummary(SummaryLabel: Text; SummaryPrompt: Text): Codeunit MobileWorkflowBuilder220FDW
Starts building a summary/review screen. Call AddSummaryItem() for each line, then let State.Serialize() finalize the output.
Parameters:
| Name | Type | Description |
|---|---|---|
SummaryLabel | Text | Label for the summary screen |
SummaryPrompt | Text | Instruction text (e.g., 'Review and confirm') |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
AddSummaryItem
procedure AddSummaryItem(ItemLabel: Text; ItemValue: Text): Codeunit MobileWorkflowBuilder220FDW
Adds a summary line item. Use Format() for non-text values.
Parameters:
| Name | Type | Description |
|---|---|---|
ItemLabel | Text | Label for the summary line |
ItemValue | Text | Value to display |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
Example:
State.StepInput()
.BeginSummary('Review Receipt', 'Confirm the details below')
.AddSummaryItem('Item', 'ITEM-001 - Widget Assembly Kit')
.AddSummaryItem('Quantity', Format(25))
.AddSummaryItem('Bin', 'BIN-A01')
.AddSummaryItem('Lot No.', 'LOT-2026-04');
exit(State.Serialize());
Custom Fields and Helpers
AddField
procedure AddField(FieldName: Text; FieldValue: Text): Codeunit MobileWorkflowBuilder220FDW
Adds a custom field to the step input JSON. If a field with the same name already exists, it is replaced.
Parameters:
| Name | Type | Description |
|---|---|---|
FieldName | Text | The JSON key name |
FieldValue | Text | The value to set |
Returns: Codeunit MobileWorkflowBuilder220FDW -- self, for chaining.
ActionOption
procedure ActionOption(ActionText: Text): Text
Creates an action option string with [ACTION] prefix for the suggestions list. Action options appear in the side pane and trigger special handling when selected by the user.
Parameters:
| Name | Type | Description |
|---|---|---|
ActionText | Text | The action label text |
Returns: Text -- the prefixed action string.
Example:
var
Suggestions: List of [Text];
begin
Suggestions.Add('LOT-2026-001');
Suggestions.Add('LOT-2026-002');
Suggestions.Add(State.StepInput().ActionOption('Generate Lot Number'));
// Produces: '[ACTION]Generate Lot Number'
State.StepInput().ConfigureWithSuggestions(
StepInputType220FDW::Text,
'enterLot',
'Enter Lot',
'Enter or select a lot number',
'',
Suggestions);
end;
Terminal Methods
HasContent
procedure HasContent(): Boolean
Returns true if any input has been buffered (scan, choice, or summary mode).
Returns: Boolean
Build
procedure Build(): JsonObject
Returns the buffered input as a JsonObject and clears the buffer. You typically do not call this directly -- State.Serialize() calls it automatically.
Returns: JsonObject -- the assembled step input JSON.
Complete Example: Receipt Workflow
This example shows how to build the step inputs for a multi-step receipt workflow:
local procedure ConfigureNextStep(var State: Codeunit MobileRPCState220FDW)
var
CurrentStep: Enum StepType220FDW;
begin
CurrentStep := State.GetCurrentStep();
case CurrentStep of
StepType220FDW::ScanItem:
State.StepInput().Configure(
StepInputType220FDW::Barcode,
'scanItem',
'Scan Item',
'Scan the item barcode');
StepType220FDW::ScanLot:
State.StepInput().Configure(
StepInputType220FDW::Text,
'scanLot',
'Lot Number',
'Scan or enter the lot number');
StepType220FDW::EnterQty:
State.StepInput().Configure(
StepInputType220FDW::Numeric,
'enterQty',
'Quantity',
'Enter the quantity to receive',
Format(RemainingQty));
StepType220FDW::SelectBin:
begin
var BinSuggestions: List of [Text];
GetAvailableBins(BinSuggestions);
State.StepInput().ConfigureWithSuggestions(
StepInputType220FDW::Barcode,
'scanBin',
'Scan Bin',
'Scan the destination bin',
SuggestedBin,
BinSuggestions);
end;
StepType220FDW::Confirm:
State.StepInput()
.BeginSummary('Confirm Receipt', 'Review and confirm')
.AddSummaryItem('Item', State.GetItemNo(false))
.AddSummaryItem('Lot', State.GetLotNo(false))
.AddSummaryItem('Quantity', Format(State.GetLastEnteredQty()))
.AddSummaryItem('Bin', State.GetBinCode(false));
end;
end;
See Also
- MobileRPCState220FDW -- the state object that owns the workflow builder
- Enums --
StepInputType220FDWenum values - MobileCommandBuilder220FDW -- queuing commands (alerts, navigation, haptics)
- MobileUIBuilder220FDW -- building info pane displays