4. Designer Event Blocks
The designer events are triggered either by actions taken by users (e.g., scanning barcodes, pressing menus, etc.) or by specific processes internal to the application framework (e.g., opening or closing an application, loading data, etc.). There should only be one instance of an event per application, and the instance should only be added to the application as needed.
The following table provides a summary of the available events. Select an event or scroll down to see more details about each event.
Event | Description |
---|---|
After Item Reservation is Added | This event is triggered after an item tracking entry has been added via the Show Reservations block. |
After Item Reservation is Changed | This event is triggered after an item tracking entry has been modified via the Show Reservations block. |
After Item Reservation is Deleted | This event is triggered after an item tracking entry has been deleted via the Show Reservations block. |
Custom Event | This event can be triggered in multiple ways and is used to execute custom processes. |
When a Bin is Scanned | This event is triggered when a bin barcode is scanned. |
When a Document is Scanned | This event is triggered when a document barcode is scanned. |
When a License Plate is Scanned | This event is triggered when a license plate barcode is scanned. |
When a License Plate is Started | This event is triggered when a license plate is started. |
When a License Plate is Stopped | This event is triggered when a license plate is stopped. |
When a License Plate Template is Scanned | This event is triggered when a license plate template barcode is scanned. |
When a Location is Scanned | This event is triggered when a location barcode is scanned. |
When a Tag is Scanned | This event is triggered when a tag barcode is scanned. |
When an Item is Scanned | This event is triggered when an item barcode is scanned. |
When Loading Document Data | This event is triggered automatically after the When the Form Opens event or by the Update Data block, and presents a Data Grid or Card Panel to the user. |
When a Package is Scanned | This event is triggered when a package barcode is scanned. |
When Quantity Should Change on a Row | This event is triggered when a menu option with the Change Qty. standard action is selected. |
When Text is Scanned | This event is triggered when a text barcode is scanned. |
When the Form Closes | This event is triggered just prior to the application closing. |
When the Form Opens | This event is triggered when the application first loads. |
The following sections outline each available event and provide a brief example of how the event can be used.
After Item Reservation is Added
This event is triggered after an Item tracking entry has been added via the Show Reservations block.
When triggered the following variables are available to the user:
- form.PackageNumber: The package number entered by the user
- VariantCode: The variant code of the originating line.
- LotNumber: The lot number entered by the user.
- SerialNumber: The serial number entered by the user.
- QuantityUserUOM: The quantity entered by the user.
- TotalQuantityLineUOM: The new combined quantity based on line UOM. This is the original line quantity to handle plus the quantity entered by the user.
- QuantityLineUOM: The quantity entered by the user but converted to the line UOM if different than the one entered by the user.
- UnitOfMeasure: The unit of measure entered by the user.
- NumberOfLabels: The number of labels requested (if applicable).
- ExpiryDate: The expiry date entered by the user.
After Item Reservation is Added Example
The following blocks from Application Designer illustrate an example of using the After Item Reservation is Added event:
After Item Reservation is Changed
This event is triggered after an item tracking entry has been modified via the Show Reservations block.
When triggered the following variables is available to the user:
- form.PackageNumber: The package number entered by the user.
- VariantCode: The variant code of the originating line.
- LotNumber: The lot number modified by the user.
- SerialNumber: The serial number modified by the user.
- QuantityUserUOM: The quantity entered by the user.
- TotalQuantityLineUOM: The new combined quantity based on line UOM. This is the original line quantity to handle plus the quantity entered by the user minus the item tracking quantity before modification.
- QuantityLineUOM: The quantity entered by the user but converted to the line UOM if different than the one entered by the user.
- UnitOfMeasure: The unit of measure entered by the user.
- NumberOfLabels: The number of labels requested (if applicable).
- ExpiryDate: The expiry date entered by the user.
After Item Reservation is Changed Example
The following Application Designer blocks illustrate an example of using After Item Reservation is Changed event:
After Item Reservation is Deleted
This event is triggered after an Item tracking entry has been deleted via the Show Reservations block.
When triggered the following variables is available to the user:
- form.PackageNumber: The package number of the item tracking entry.
- VariantCode: The variant code of the originating line.
- LotNumber: The lot number deleted by the user.
- SerialNumber: The serial number deleted by the user.
- TotalQuantityLineUOM: The new combined quantity based on line UOM. This is the original line quantity to handle – the item tracking quantity being deleted.
- QuantityLineUOM: The negative quantity of the item tracking quantity being deleted but converted to line UOM.
- UnitOfMeasure: The unit of measure of the originating line.
- ExpiryDate: The expiry date of the item tracking entry.
After Item Reservation is Deleted Example
The following Application Designer blocks illustrate an example of using the After Item Reservation is Deleted event:
Custom Event
The custom event block is triggered by one of two ways:
- A Device Menu with a “Custom Application Event” standard action of; the event to trigger is specified in the Event Name property on the menu.
- Using a Start Event block.
You can use this block to tie menu actions to custom processes and make the application design more readable and re-usable.
Block Configuration:
Option | Description |
---|---|
Name | The name of the event and is referenced in the Custom Application Event property on a device menu or the Event Name option on the “Start Event” block. |
Custom Event Example
The following Application Designer blocks illustrate an example of using Custom Event:
When a Bin is Scanned
This event is triggered when a bin barcode is scanned. This event is fired after the barcode has been validated by Business Central (if required). You need to handle the actions to take (if any) when a bin is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the bin barcode variables into the page context and then take appropriate action from there.
When a Bin is Scanned Example
The following Application Designer blocks illustrate an example of using When a Bin is Scanned:
When a Document is Scanned
This event is triggered when a document barcode is scanned. Document barcode formats are fixed and are always preceded by a unique type identifier. If you are intending to scan a document that does not have the identifiers present then it needs to be interpreted as a Text barcode.
You need to handle the actions to take (if any) when a document is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the document barcode variables into the page context and then take appropriate action from there.
When a Document is Scanned Example
The following Application Designer blocks illustrate an example of using When a Document is Scanned:
When a License Plate is Scanned
This event is triggered when a license plate barcode is scanned. This event is fired after the barcode has been validated by Business Central. You need to handle the actions to take (if any) when a license plate is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the license plate barcode variables into the page context and then take appropriate action from there.
When a License Plate is Scanned Example
The following Application Designer blocks illustrate an example of using When a License Plate is Scanned:
When a License Plate is Started
This event is triggered when a PDA menu with a standard action of LP Create is pressed. The application internally keeps track of the menu state and toggle it between start and stop, so depending on what state the menu is in this or the When a License Plate is, Stopped event triggers.
You need to handle the actions to take (if any) when the request is made.
When a License Plate is Started Example
The following Application Designer blocks illustrate an example of using When a License Plate is Started:
When a License Plate is Stopped
This event is triggered when a PDA menu with a standard action of LP Create is pressed. The application internally keeps track of the menu state and toggle it between start and stop so depending on what state the menu is in this or the When a License Plate is Started event triggers.
You need to handle the actions to take (if any) when the request is made.
When a License Plate is Stopped Example
The following Application Designer blocks illustrate an example of using When a License Plate is Stopped:
When a License Plate Template is Scanned
This event is triggered when a License Plate Template barcode is scanned. You need to handle the actions to take (if any) when a License Plate Template is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the License Plate Template barcode variables into the page context and then take appropriate action from there.
When a License Plate Template is Scanned Example
The following Application Designer blocks illustrate an example of using When a License Plate is Scanned:
When a Location is Scanned
This event is triggered when a Location barcode is scanned. This event fires after the barcode has been validated by Business Central. You need to handle the actions to take (if any) when a location is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the location barcode variables into the page context and then take appropriate action from there.
When a Location is Scanned Example
The following Application Designer blocks illustrate an example of using the event:
When a Tag is Scanned
This event is triggered when a tag barcode is scanned. You need to handle the actions to take (if any) when a tag is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the Tag barcode variables into the page context and then take appropriate action from there.
When a Tag is Scanned Example
The following Application Designer blocks illustrate an example of using When a Tag is Scanned:
When an Item is Scanned
This event is triggered when an item barcode is scanned. This event fires after the barcode has been decoded/processed in Business Central. You need to handle the actions to take (if any) when an item is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the item barcode variables into the page context and then take appropriate action from there.
This event is integrated with the scan quantity change scan behaviors defined in Business Central.
When an Item is Scanned Example
The following Application Designer blocks illustrate an example of using the When an Item is Scanned:
When Loading Document Data
If this block is added, the application presents a Data Grid or Card Panel to the user. This block triggers after the When the Form Opens. In addition, the event can be triggered by an Update Data… block. The only action required in this event is to get the dataset from Business Central so that the grid can be populated.
When Loading Document Data Example
The following Application Designer blocks illustrate an example of using When Loading Document Data:
When a Package is Scanned
This event is triggered when you scan a Package barcode. You need to handle the actions to take (if any) when a Package is scanned. Typically, you include a Using the Last Scanned Barcode block to push the Package barcode variables into the page context and then take appropriate action from there.
When a Package is Scanned Example
The following Application Designer blocks illustrate an example of using When a Package is Scanned:
When Quantity Should Change on a Row
This event is only triggered when a menu option with a standard action of Change Qty is pressed. This event is meant for manual quantity changes for a selected line and is integrated with the manual quantity change scan behaviors defined in Business Central.
When Quantity Should Change on a Row Example
The following Application Designer blocks illustrate an example of using When Quantity Should Change on a Row:
When Text is Scanned
This event is triggered when a text barcode is scanned. A text barcode is not decodable as anything else (e.g., Item, Bin, LP, document, etc.). The process flow attempts to decode the text barcode as an item or bin. If those fail, this event is raised.
You need to handle the actions to take (if any) when a text barcode is scanned. Typically, you would include a Using the Last Scanned Barcode block to push the text barcode variables into the page context and then take appropriate action from there.
When Text is Scanned Example
The following Application Designer blocks illustrate an example of using When Text is Scanned:
When The Form Closes
This event is triggered just prior to the application closing. You may take additional action at this point (e.g., posting, printing, etc.) but you are unable to prevent the page from being closed.
When The Form Closes Example
The following Application Designer blocks illustrate an example of using When the Form Closes:
When The Form Opens
The When the Form Opens event is triggered when the application first loads. The event is only ever fired once and is used to initialize the application (e.g., setting the form title, initializing variables, etc.). For simple processes (e.g., asking users for input and then closing the form), this event is considered the starting point.
When The Form Opens Example
The following Application Designer blocks illustrate an example of using When the Form Opens: