How can I add success and failure notifications?

Generally it’s a pretty nice thing to let your users know that the transaction they just entered was successful. This article shows how you can add simple success and failure notifications.

Toasts are a great way of doing that, they are unobtrusive, automatically dismiss themselves, and don’t interfere with the user interacting with the app. In this case, I am doing a location transfer, and I want to let the user know that it was successful:


In this case, when the user scans the quantity, an ‘On Demand’ data subscription called CommitTransfer is called. This is a dynamic plugin I wrote using C# on the Bezlio Remote Data Broker server located in the Dynamic folder of my installation directory.


It is important to mark it as an ‘On Demand’ data subscription so that it does not try and run the data subscription when the bezl is first launched. The code to tell Bezlio to process the data subscription is:



Now I need to check the results of the data subscription and if it is successful, show our notification. I do this in onDataChange:

switch( {
case 'CommitTransfer':
if ( == 'Success' ) {
bezl.notificationService.showSuccess('Location Transfer Successful!');
} else {


I am switching on because onDataChange is called every time a data subscription is returned. I can use to know what data subscription is being returned, and I only want this code to call when CommitTransfer returns. My Dynamic plugin returns success if successful and throws an error otherwise. I can use bezl.notificationService.showSuccess to show a success message or showError if there is an error.