Scan Input Configuration
Guide to configuring barcode scanning, manual entry, and input controls on the Aptean Mesh mobile client using the MobileWorkflowBuilder220FDW.
Overview
Scan input configuration determines what the mobile app prompts the user for at each workflow step -- a barcode scanner, text field, numeric keypad, date picker, choice list, or summary screen. The configuration is built using State.StepInput() and flushed into the RPC response when State.Serialize() is called.
User scans barcode ──> RPC request ──> AL handler reads input
│
▼
AL handler sets next step input
│
▼
State.Serialize() ──> RPC response
│
▼
Mobile app shows configured input
Barcode Scanning
The Barcode input type activates the camera or hardware scanner and accepts scanned barcodes. It also allows manual text entry as a fallback.
State.StepInput().Configure(
StepInputType220FDW::Barcode,
'scanItem',
'Scan Item',
'Scan the item barcode or enter it manually');
Hardware Scanner Support
Input types Barcode, Text, and Numeric accept input from hardware barcode scanners (e.g., Zebra devices with integrated scanners). The mobile app sets acceptsHardwareScan to true for these types automatically. Other input types (DatePicker, Image, Choice, Summary, StatusInfo) do not accept hardware scans.
Reading Scanned Values
After the user scans or enters a value, read it using the state accessors:
// Recommended: GetScannedValue checks input field, then barcode AI data, then raw barcode
var
ItemNo: Text;
begin
ItemNo := State.GetScannedValue('01'); // '01' = GTIN AI code
// Alternative: read raw barcode directly
// ItemNo := State.RawBarcode();
end;
For GS1 barcodes, the mobile client parses Application Identifiers automatically. Use State.GetDataFromAICode() or State.GetScannedValue() with AI codes to extract specific fields. See MobileRPCState220FDW -- Barcode Accessors for details.
Manual Text Entry
The Text input type shows a free-form text field. Use it for lot numbers, serial numbers, or other text values that may not have barcodes.
State.StepInput().Configure(
StepInputType220FDW::Text,
'enterLot',
'Lot Number',
'Enter the lot number');
Numeric Entry
The Numeric input type shows a numeric keypad. Use it for quantities, counts, and other numeric values.
State.StepInput().Configure(
StepInputType220FDW::Numeric,
'enterQty',
'Quantity',
'Enter the quantity to receive',
Format(SuggestedQty)); // Pre-fill with suggested value
Date Picker
The DatePicker input type shows a calendar date selector.
State.StepInput().Configure(
StepInputType220FDW::DatePicker,
'selectExpDate',
'Expiration Date',
'Select the expiration date');
Suggestions Side Pane
Add a side pane with suggested values using ConfigureWithSuggestions(). The user can tap a suggestion or enter a value manually.
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 or select from suggestions',
'BIN-A01', // Default value
BinSuggestions);
end;
Action Options in Suggestions
Use ActionOption() to add special action items to the suggestions list. Action options are prefixed with [ACTION] and trigger custom handling when selected.
var
Suggestions: List of [Text];
begin
Suggestions.Add('LOT-2026-001');
Suggestions.Add('LOT-2026-002');
Suggestions.Add(State.StepInput().ActionOption('Generate Lot Number'));
State.StepInput().ConfigureWithSuggestions(
StepInputType220FDW::Text,
'enterLot',
'Enter Lot',
'Enter or select a lot number',
'',
Suggestions);
end;
Pre-selected Value
Use ConfigureWithSuggestionsAndSelected() to show a radio-button selection with a value already selected:
var
UOMOptions: List of [Text];
begin
UOMOptions.Add('PCS');
UOMOptions.Add('BOX');
UOMOptions.Add('PALLET');
State.StepInput().ConfigureWithSuggestionsAndSelected(
StepInputType220FDW::Text,
'selectUOM',
'Unit of Measure',
'Select the unit of measure',
'PCS', // Default value in input field
UOMOptions,
'PCS'); // Pre-selected radio button
end;
Choice Selection
Present the user with a list of options using the choice mode:
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', 'move_to_inbox')
.AddChoice('count', 'Count', 'Physical inventory count', 'inventory');
exit(State.Serialize());
Each choice has a key (returned when selected), label (displayed), and optional description and Material icon.
Summary / Confirmation
Show a review screen before finalizing an operation:
State.StepInput()
.BeginSummary('Confirm Receipt', 'Review the details and confirm')
.AddSummaryItem('Item', 'ITEM-001 - Widget Assembly Kit')
.AddSummaryItem('Quantity', Format(25))
.AddSummaryItem('Bin', 'BIN-A01')
.AddSummaryItem('Lot No.', 'LOT-2026-04');
exit(State.Serialize());
Undo Support
All scan inputs configured via Configure() automatically include an undo action (undoActionId: "onUndo"). When the user taps the undo button, the mobile app sends a new RPC call with the onUndo action, allowing your handler to step backwards in the workflow.
Complete Example: Multi-Step Workflow
local procedure ConfigureNextStep(var State: Codeunit MobileRPCState220FDW)
var
CurrentStep: Enum StepType220FDW;
begin
CurrentStep := State.GetCurrentStep();
case CurrentStep of
StepType220FDW::ScanItem:
// Step 1: Scan item barcode
State.StepInput().Configure(
StepInputType220FDW::Barcode,
'scanItem', 'Scan Item', 'Scan the item barcode');
StepType220FDW::ScanLot:
// Step 2: Enter lot number with suggestions
begin
var LotSuggestions: List of [Text];
GetAvailableLots(State.GetItemNo(true), LotSuggestions);
State.StepInput().ConfigureWithSuggestions(
StepInputType220FDW::Text,
'scanLot', 'Lot Number', 'Scan or enter lot number',
'', LotSuggestions);
end;
StepType220FDW::EnterQty:
// Step 3: Enter quantity with numeric keypad
State.StepInput().Configure(
StepInputType220FDW::Numeric,
'enterQty', 'Quantity', 'Enter quantity to receive',
Format(GetRemainingQty(State)));
StepType220FDW::ScanBin:
// Step 4: Scan destination bin
begin
var BinSuggestions: List of [Text];
GetSuggestedBins(State, BinSuggestions);
State.StepInput().ConfigureWithSuggestions(
StepInputType220FDW::Barcode,
'scanBin', 'Scan Bin', 'Scan the destination bin',
GetDefaultBin(State), BinSuggestions);
end;
StepType220FDW::Confirm:
// Step 5: Review and 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
- MobileWorkflowBuilder220FDW -- the builder codeunit API reference
- MobileRPCState220FDW -- reading scanned values and barcode data
- Enums --
StepInputType220FDWvalues