Skip to main content

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:

ModeDescriptionBuilder entry point
Scan InputBarcode scanner, text field, numeric keypad, date pickerConfigure()
ChoiceSelection list with optionsBeginChoice() + AddChoice()
SummaryReview/confirmation screen with key-value pairsBeginSummary() + 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());
tip

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.

ValueCaptionHardware ScanDescription
BarcodeBarcodeYesBarcode scanner with camera/hardware scan support
TextTextYesFree-form text input
NumericNumericYesNumeric keypad
DatePickerDatePickerNoDate selection calendar
ImageImageNoImage capture
ChoiceChoiceNoSelection from a list of options
StatusInfoStatusInfoNoStatus information display
SummarySummaryNoReview/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:

NameTypeDescription
WorkflowStepRecord "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:

NameTypeDescription
InputTypeEnum StepInputType220FDWThe type of input control
StepIdTextUnique identifier for this step
StepLabelTextLabel displayed on the input control
PromptTextInstruction 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:

NameTypeDescription
InputTypeEnum StepInputType220FDWThe type of input control
StepIdTextUnique identifier for this step
StepLabelTextLabel displayed on the input control
PromptTextInstruction text for the user
DefaultValueTextPre-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:

NameTypeDescription
InputTypeEnum StepInputType220FDWThe type of input control
StepIdTextUnique identifier for this step
StepLabelTextLabel displayed on the input control
PromptTextInstruction text for the user
DefaultValueTextPre-filled value
SuggestValuesList 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:

NameTypeDescription
InputTypeEnum StepInputType220FDWThe type of input control
StepIdTextUnique identifier for this step
StepLabelTextLabel displayed on the input control
PromptTextInstruction text for the user
DefaultValueTextPre-filled value in the input field
SuggestValuesList of [Text]List of suggested values shown in the side pane
SelectedValueTextThe 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:

NameTypeDescription
ChoiceLabelTextLabel for the choice screen
ChoicePromptTextInstruction 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:

NameTypeDescription
ChoiceKeyTextUnique key returned when this option is selected
ChoiceLabelTextDisplay label for the option
ChoiceDescriptionTextOptional description text (pass '' to omit)
ChoiceIconTextOptional 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:

NameTypeDescription
SummaryLabelTextLabel for the summary screen
SummaryPromptTextInstruction 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:

NameTypeDescription
ItemLabelTextLabel for the summary line
ItemValueTextValue 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:

NameTypeDescription
FieldNameTextThe JSON key name
FieldValueTextThe 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:

NameTypeDescription
ActionTextTextThe 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