Toast Messages

Toast messages are used to notify users with important information using a modal message box. These notification messages pop up in the bottom of the screen but do not require the user to dismiss them.

There are four types of toast messages; SUCCESS, INFO, WARNING, and ERROR.

Toast Messages

Figure 1 - Toast Messages

Variations

None.

When to use

Toast messages can be used to notify the user in a specific scenario.

Limitations

None.

How to use

Toast messages are initiated through commands. There are four instructions within the commands for this; success, info, warning, and error. Each instruction takes a message (which is mandatory) and a title (which is optional). See code example below:

command NotificationExample {
   label = "Test notifications";
   execute {
      success("You are welcome!", "Success!");
      info("Just some information for you.");
      warning("You are being warned", "Alert!");
      error("This is not good!", "Oops!");
   }
}

Keywords

None.

Properties

None.

Example

Below is a simple example of the use of a toast message.

command ConnectActivityCmd for BusinessOpportunity {
   label = "Connect Activity";
   enabled = [not(Objstate in("Closed", "Cancelled"))];
   execute {
      assistant ConnectActivitiesAssistant(OpportunityNo, Company, CustomerId, "CUSTOMER", "BUSINESS_OPPORTUNITY") {
         when OK {
            success("Business Activities connected");
            exit;
         }
      }
   }
}

Example - Simple Toast Message