5. Designer Interaction Blocks
The designer interaction blocks are user interfaces that are used to display information or gather feedback (e.g., input dialogs, quantity dialogs, message boxes, etc.). The interface layout cannot be modified and may display differently depending on the operating system running Warehouse Insight.
The following table provides a summary of the available interactions. Select an interaction or scroll down to see more details about each interaction.
Block | Description |
---|---|
Ask for a Date | Displays a dialog to the user asking for a date. |
Ask for a Number | Displays a dialog to the user asking for a number. |
Ask for Confirmation | Displays a dialog to the user asking for confirmation (Yes/No). |
Ask for Text | Displays a dialog to the user asking for a text value. |
Capture Signature | Displays a dialog to the user asking for a signature. |
Choose From List | Displays a dialog to the user asking for a selection from a dropdown/picker control. |
Choose From Table | Displays a dialog to the user asking for a selection from a grid. |
Choose With Buttons | Displays a dialog to the user asking for a selection from a series of buttons. |
Display a Message | Displays a dialog with a message to the user. |
Display an Error | Displays a dialog with an error to the user. |
Display a Popup Message | Displays a temporary message to the user that hides after a brief period. |
Editable Panel | Displays a dialog with various editable fields to the user. |
Enter Quantity | Display a dialog to the user to enter a quantity (typically for a selected document line). |
Show Assign LP | Special purpose block to handle when a user scans/assigns a license plate to a document. |
Show LP List | Displays a list of license plates to the user with additional functionality for managing the license plates. |
Show Picture | Displays a dialog to the user with an image. |
Show Reservations | Displays the item tracking lines for the selected document line. |
Inspect Context | Special purpose block that displays the current application variables and values. Used for development and debugging. |
The following sections outline each available interaction and provide an example of how the interaction can be used.
Ask for a Date
The Ask for a Date block displays a dialog to the user asking for a date:
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. |
Prompt | The prompt or message to display to the user. |
Date Format | The date format to force the date to. If not specified, it uses the format of the device (e.g., dd/MM/yy). |
Default Date | The default date to select. If not specified, the current date will be selected. |
When executed, users see a dialog like this:
When closed, press OK again to accept the value previously selected.
After execution, the following variables are set:
- dialog_result: 0 if Cancel is pressed, 1 if OK is pressed.
- action_result: Contains the date entered as displayed.
- date_universal: Contains the date formatted to universal full date/time format.
Ask for a Date Example
Provided below is an example of an Application Designer block using Ask for a Date:
Ask for a Number
The Ask for a Number block displays a dialog to the user asking for a simple number value. The dialog does not factor in units of measure or have abilities to limit to integers specifically.
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. |
Prompt | The prompt to display to the user. |
Default Value | The initial value for the dialog. |
Min | The minimum value allowed to be entered. |
Max | The maximum value allowed to be entered. |
Allow Decimals | True if decimals should be allowed, false if only integers. |
When executed, users see a dialog like this:
After execution, the following variables are set:
- dialog_result: Will be 0 if Cancel is pressed, 1 if OK is pressed.
- action_result: Will contain the value entered.
Ask for a Number Example
The Application Designer example below uses Ask for a Number:
Ask for Confirmation
Ask for Confirmation displays a dialog to the user asking for confirmation (yes/no).
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. If this value is left blank, a standard confirm title is used. |
Message | The confirmation message to display to the user. |
After execution, the following variables are be set:
- dialog_result: Will be 7 if No is pressed, 6 if Yes is pressed.
Ask for Confirmation Example
The Application Designer example below uses Ask for Confirmation:
Ask for Text
Ask for a Text displays a dialog to the user asking for a text value.
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. |
Prompt | The prompt to display to the user. |
Default Value | The initial value to display when the dialog opens. |
Max Length | The maximum text length that can be entered. |
Close on Barcode Scan | Yes – if a barcode is scanned, the dialog closes. No – if a barcode is scanned, the dialog does not close automatically. |
In addition to the published configuration options, there are a few variables that can be created/set to help further override the dialog behavior:
Option | Description |
---|---|
override_decode_scans | If this variable is defined in the application, it determines if a barcode scan should follow the normal decoding processes. For example, if the value is set to true and a license plate barcode is scanned (e.g., %LP%LP00001), it calls Business Central functions to determine if the LP is valid and retrieve the license plate lines and details. this extra processing is sometimes not required. if the value is set to false, the text field only gets the license plate number (e.g., LP00001) and sets that in the text field. The default value is true. |
When executed, users see a dialog like this:
After execution, the following variables are set:
- dialog_result_int: 0 if Cancel is pressed, 1 if OK is pressed.
- action_result: Contains the value entered.
Ask for Text Example
The Application Designer block below is an example of using Ask for Text:
Capture Signature
Capture Signature displays a dialog to the user asking for a signature. The signature data must still be processed/handled in Business Central.
Block Configuration:
Option | Description |
---|---|
Require Name | Use True if the user must also type in the user’s name prior to closing the signature dialog. Use False if the requirement to type in the user’s name is optional. If not specified, the default is False. |
When executed, users see a dialog like this:
After execution, the following variables are set:
- dialog_result: Will be 0 if Cancel is pressed, 1 if OK is pressed.
- signature_name: Will contain the name typed in.
- Blob: The signature data.
Capture Signature Example
The Application Designer block below is an example of a Capture Signature block. The first part indicates the minimal Application Designer block sequences required. The second part takes the signature and attaches the image to a Sales Order based on the signature name that was entered.
Business Central Code:
Choose From List
Choose From List displays a dialog to the user asking for selection from a dropdown/picker control.
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. |
Prompt | The prompt to display to the user. |
Options | A comma-separated string of options available. |
Default | The option to select by default. If none specified, the first option is selected. |
When executed, users see a dialog like this:
Selecting the entry causes the list options to appear:
After execution, the following variables are set:
- dialog_result: 0 if Cancel is pressed, 1 if OK is pressed.
- Selection: Is the index of the selection made (0 being the first option).
- selection_text: Is the text of the selection made.
Choose From List Example
The Application Designer example below uses Choose From List:
Choose From Table
Choose From Table displays a dialog to the user asking for a selection from grid.
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. |
Prompt | The prompt to present to the user. |
Table ID | The table number to retrieve data from. |
Table Filter | The filter to apply to the data results. |
Table Fields | Comma separated list of fields to return. |
Event ID | A Business Central event to be executed instead of specify the generic table information. |
When executed, users see a dialog like this:
Note: Typing values into the filter control limits the results based on the value entered across all the visible columns.
After execution, the following variables are set:
- dialog_result: 0 if Cancel is pressed, 1 if OK is pressed.
- FieldName: Every field on the selected row is returned with the FieldName replaced as needed.
Choose From Table Example – Table Filters
The Application Designer example below uses Choose From Table:
Choose From Table Example – Event ID
The Application Designer example below uses the Choose From Table block and a specified Event ID:
Business Central Code:
Device Columns:
Choose With Buttons
Choose With Buttons displays a dialog to the user asking for selection from a series of buttons.
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. |
Prompt | The prompt to display to the user. |
Options | A comma separated string of options available. |
When executed, users see a dialog like this:
After execution, the following variables are set:
- dialog_result: 0 if Cancel is pressed, 1 if OK is pressed.
- Selection: The index of the selection made (0 being the first option).
- selection_text: The text of the selection made.
Choose With Buttons Example
The Application Designer example below uses Choose With Buttons:
Display a Message
Display a Message displays a message to the user.
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. If this value is left blank, a standard Message title is used. |
Message | The message to display to the user. |
When executed, users see a dialog like this:
Display a Message Example
The Application Designer example below uses Display a Message:
Display an Error
Similar to Display a Message, Display an Error displays a message to the user. The block may be styled differently depending on the Operating System. The error message logs as a Warning to the log file.
Block Configuration:
Option | Description |
---|---|
Title | The title for the dialog. If this value is left blank, a standard Error title is used. |
Message | The error to display to the user. |
When executed, users see a dialog like this:
The Application Designer example below uses Display an Error:
Display a Popup Message
Display a Popup Message displays a message to the user that hides after a brief period.
Block Configuration:
Option | Description |
---|---|
Message | The message to display to the user. |
Interval | The length of time before the message disappears.
|
When executed, users see a dialog like this:
Display a Popup Message Example
The Application Designer example below uses Display a Popup Message:
Editable Panel
Editable Panel allows users to modify a record in a dynamic fashion. When executed a dialog displays with various editable fields based on the dataset supplied.
Block Configuration:
Option | Description |
---|---|
Title | The title to set on the dialog. |
Prompt | The prompt to display to the user. |
Load Event ID | The event in Business Central to get the dataset from. The event must return a standard dataset. |
Save Table View | The filter to apply to the record when saving the data back. If a filter is applied, it executes event 920 and utilize the PDA columns defined from the Load Event ID to match on.
If no filter is applied, then saving of the results must be handled via code. Panel results are stored in variables prefixed with setfld followed by the field name. |
Label Position | The position to put the labels on the editable fields. Specify Top if you want the labels to be on top of the editable field. Specify Left if you want the label to be to the left of the editable field. |
# of Columns | Indicate the number of columns you want to display in the panel. Minimum 1. |
When executed, users see a dialog like this:
- The control types and editable states of the panel are controlled via the column definition returned in the dataset.
- The field is editable if there is an Editor specified for the column (e.g., TextBox, ComboBox, CheckBox).
- The type of editor depends on the Data Type.
- Option fields use ComboBox.
- Text and Decimal fields use TextBox though decimal fields have a numeric entry.
- Boolean fields use CheckBox.
- If you do not want the label to be shown but just want the value, then set Show Caption to false.
- If you do not want the field to be shown at all, then set Column Visible property to false.
Editable Panel Example 1
The Application Designer example below uses the Editable Panel block while using the automatic saving abilities. To make use of the automatic saving, Save Table View filter must be set.
Business Central Code:
Device Columns:
Example Output:
Editable Panel Example 2
The Application Designer example below uses the Editable Panel block and manually saves the results. Manual saving occurs because of not specifying Save Table View.
Business Central Code:
Device Columns:
Enter Quantity
Enter Quantity is used to prompt the user to enter quantity (typically for a selected document line). The block is tightly tied to Scan Behaviors as well as the menu standard action Change Qty.
Block Configuration:
Option | Description |
---|---|
Require LN | True if the dialog shows a Lot Number field.
False if the dialog hides the Lot Number field (including the lot information button). |
Require SN | True if the dialog shows a Serial Number field.
False if the dialog hides the Serial Number field (including the serial information button). |
Auto Generate LN/SN | True if the dialog generates a Lot or Serial number if one is not specified. |
Label Default Qty. | Enter an integer value greater than negative one to include a field on the dialog to enter number of labels to print. If left blank, input field is hidden. |
Using xxx Line | Choose Existing to utilize data from the selected line.
Choose New to assume no line required/selected. |
When the block is executed, it references the Scan Behaviors to determine the default unit of measure, default quantities and whether to allow excess.
The block also relies on Configure Fields to determine maximum values and reference field information.
There are a few variables that can be created/set to help further override the dialog behavior:
Override Variable | Description |
---|---|
override_event_behavior | If this variable is defined in the application, it overrides the normal event behavior for the dialog. Event behaviors indicate the source behavior of the quantity dialog that initiated the flow. Possible values are integer and correlate to the following:
Setting to 0 reverts the dialog to using base behavior. |
override_description | If this variable is defined in the application, it replaces the normally displayed Item’s description and description2 values with this. Leave blank or undefined to default to normal behavior. |
override_serial_caption | If this variable is defined in the application, it replaces the normally displayed “Serial Number:” prompt with this. Leave blank or undefined to default to normal behavior. |
override_serial_number | If this variable is defined in the application, it replaces the normally populated serial number value with this. Leave blank or undefined to default to normal behavior. |
override_allow_change_serial | If this variable is defined in the application, it determines whether users can change the serial number. False to prevent changing the serial number. True to allow changing the serial number. |
override_lot_caption | If this variable is defined in the application, it replaces the normally displayed “Lot Number:” prompt with this. Leave blank or undefined to default to normal behavior. |
override_lot_number | If this variable is defined in the application, it replaces the normally populated lot number value with this. Leave blank or undefined to default to normal behavior. |
override_allow_change_lot | If this variable is defined in the application, it determines whether users can change the lot number. False to prevent changing the lot number. True to allow changing the lot number. |
override_expiry_caption | If this variable is defined in the application, it replaces the normally displayed “Expiry Date:” prompt with this. Leave blank or undefined to default to normal behavior. |
override_expiry_date | If this variable is defined in the application, it replaces the normally populated expiry date value with this. Leave blank or undefined to default to normal behavior. |
override_allow_change_expiry | If this variable is defined in the application, it determines if the expiry date is changeable and shown. True to allow changing expiry. False to prevent changing expiry and the field is hidden. |
override_quantity_caption | If this variable is defined in the application, it replaces the normally displayed “Quantity:” prompt with this. Leave blank or undefined to default to normal behavior. |
override_quantity | If this variable is defined in the application, it overrides the scan behavior default quantity value with this. Leave blank or undefined to default to normal behavior. |
override_allow_excess | If this variable is defined in the application, it overrides the scan behavior allow excess option. True to have no maximum value. False to respect the maximum value. |
override_allow_negative | If this variable is defined in the application, it overrides the dialog’s default behavior of allowing negative numbers. False to prevent negative numbers. True to allow negative numbers. |
override_default_uom | If this variable is defined in the application, it overrides the scan behavior default unit of measure value with this. Leave blank or undefined to default to normal behavior. |
override_allow_change_uom | If this variable is defined in the application, it determines whether users can change the unit of measure. False to prevent changing unit of measure. True to allow changing unit of measure. |
override_label_caption | If this variable is defined in the application, it replaces the normally displayed “# of Labels:” prompt with this. Leave blank or undefined to default to normal behavior. |
When executed, users see a dialog like this:
After execution, the following variables are set:
Variable | Description |
---|---|
dialog_result | 0 (or Cancel) if Cancel is pressed, 1 (or OK) if OK is pressed. |
form.LotNumber | The lot number entered in the dialog |
form.SerialNumber | The serial number entered in the dialog. |
form.PackageNumber | The package number entered in the dialog. |
form.QuantityUserUOM | The quantity entered in the dialog. |
form.QuantityLineUOM | The quantity entered in the dialog converted to the line unit of measure. |
form.TotalQuantityLineUOM | The quantity entered in the dialog converted to the line unit of measure, plus the existing quantity to handle (as defined in the Configure Fields block). |
form.UnitOfMeasure | The unit of measure chosen in the dialog. |
form.NumberOfLabels | The number of labels to print entered in the dialog. |
form.ExpiryDate | The expiry date entered in the dialog. |
Enter Quantity Example
The Application Designer example below uses Enter Quantity:
Show Assign License Plate
Show Assign LP is a special purpose block to handle when a user scans/assigns a license plate to a document. This block displays a dialog indicating the current document requirements against the license plate contents.
Block Configuration:
Option | Description |
---|---|
Event ID | The event to call to handle the actual assignment. |
LP Number | The License Plate number being assigned. |
When executed, users see a dialog like below. Pressing OK triggers the event defined in Event ID to be fired and the appropriate assignment actions to be taken.
Show Assign License Plate Example
The Application Designer example below uses Show Assign LP:
Show License Plate List
Show LP List displays a list of license plates with some additional built in functionality for managing the license plates.
Block Configuration:
Option | Description |
---|---|
Show Assigned | True if the listing is filtered to only those assigned to the current document. |
Show Available | True if the listing includes license plates that are not actively assigned to a document. |
Allow Remove | True if the dialog provides an option for removing the selected license plates assignment. |
Allow New | True if the dialog provides an option for creating a new license plate. |
When executed, users see a dialog like this:
After execution, the following variables are set:
- dialog_result: 0 if Cancel is pressed, 1 if OK is pressed.
- action_result: The license plate number selected.
Show License Plate List Example
The Application Designer example below uses Show LP List. Only the Application Designer blocks are shown as it is sufficient to illustrate the inputs and outputs.
Show Picture
Show Picture block displays a dialog to the user with an image. The Dialog closes after a specified period unless explicitly forced to stay open by the user.
Block Configuration:
Option | Description |
---|---|
File Name | Deprecated. Do not use. |
Image Blob | The blob variable to load the image data from. |
Display Time | The number of seconds to remain open for before auto closing. |
Enabled | True if the dialog should be shown; False if not. Deprecated as recommended to put check prior to even executing the block. |
When executed, users see a dialog like this:
Show Picture Example
The Application Designer example below uses Show Picture:
Show Reservations
Show Reservations is used to prompt display the item tracking lines for a selected line. The dialog allows adding, modifying and deleting tracking lines. The block is tied to Scan Behaviors as well as the menu standard action Change Qty and requires the Item Reservation events to be defined. The quantity dialog displayed when required is the same as Enter Quantity and provides largely the same features and overrides.
Block Configuration:
Option | Description |
---|---|
Require LN | True if the quantity dialog should show a field for the Lot Number. False if the dialog should hide the Lot Number field (including the lot information button). |
Require SN | True if the quantity dialog should show a field for the Serial Number.
False if the dialog should hide the Serial Number field (including the serial information button). |
Auto Generate LN/SN | True if the quantity dialog should generate a Lot or Serial number if one is not specified. |
Label Default Qty. | Enter an integer value greater than negative one to include a field on the quantity dialog to enter number of labels to print. If left blank, input field hidden. |
When executed, users see a dialog like this:
See the events After Item Reservation is Added, After Item Reservation is Changed, and After Item Reservation is Deleted for expected outputs.
Show Reservations Example
The Application Designer example below uses Show Reservations. The example is based on a manual quantity change of a transfer shipment line.
Inspect Context
Inspect Context displays a list of all the current available variables and their values. The variables are not limited to those that are specifically defined in the Application but include things like selected line data, barcode results, and device configuration.
The block is not intended for end user use but serves as a helpful block while designing applications.
When executed, users see a dialog like this:
Inspect Context Example
The Application Designer example below uses Inspect Context: