# Class Utility#createToast

Utility

- Defined in: utility.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Utility#createToast(successCallback, errorCallback, create ToastMessage

## Class Detail

Utility#createToast(successCallback, errorCallback,
create ToastMessage

    // Javascript code

    function createToast () {
      var options = {
         msg : "test message"
      };

      function successCb() {
         // Do something
      }

      function failureCb(cbObject) {
         var errorCode = cbObject.errorCode;
         var errorText = cbObject.errorText;
         console.log ("Error Code [" + errorCode + "]: " + errorText);
      }

      var utility = new Utility();
      utility.createToast(successCb, failureCb, options);
    }

Parameters:
{Function} successCallback
  success callback function.
{Function} errorCallback
  failure callback function.
{Object}
  align=left>

  Property | Type | Description | Required
  --- | --- | --- | ---
  msg | String | output string to toast message | required

Since:
  1.4
Returns:

  If the method is successfully executed, call the success callback function without a parameter. If an error occurs, failure callback function is called with failure callback object as a parameter.