Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Customize Omniscript Error Messages

          Customize Omniscript Error Messages

          The error message handler enables you to replace default error messages from remote apex calls with more user-friendly error messages when errors occur in Omniscript. The Error Messages handler property is available in File elements, Image elements, all Action elements, and Setup.

          Note
          Note

          Error Messages set in the Setup properties apply to any matching error returned by an element, while Error Messages set in an Action’s properties only render for that Action.

          Error Message Type

          Description

          Default Error Message

          A default message that returns when no Custom Error Messages are matched or defined.

          Custom Error Messages

          Messages that are returned based on the defined path and value. Custom Error Messages are configured using the following fields:

          • Path: A merge field path that locates the original default value inside an error object.

          • Value: The original error message, including spaces, that will be replaced by the text defined in the Message field. This value must match the original error exactly.

          • Message: The custom message that will replace the error text defined in the Value field.

          Set the Default Error Message on an Omniscript Element

          Replace a Default Error Message with a user-friendly error message when a remote apex call error occurs in your Omniscript. A default message returns when no custom error messages are matched or defined. Update the default error messages for Image, Action, and File elements.

          Before You Begin

          Before configuring Error Messages, preview the errors to determine their format.

          1. Open the Error Messages property in the element that renders the error.
          2. In the Default Error Message field, enter your custom message.
          3. Preview the error to ensure the message renders.

          Set a Custom Error Message That Returns as an Object

          Set a Custom Error Message for an error that returns as an object. A Custom Error Message returns based on a defined path and value. Set custom error messages for File elements, Image elements, all Action elements, and Setup.

          Before You Begin

          Before configuring Error Messages, preview the errors to determine their format.

          1. Run the Omniscript to encounter the error.
          2. Determine the path to the error. For example, the path for errorCode in the following error [{"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}] is 0 | : | errorCode .
          3. Copy the error message text that follows the path. For example, the error message text for errorCode in the following error: [{"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}] is NOT_FOUND .
          4. Open the Error Messages property in the Action Element that is rendering the error.
          5. In the Path field, enter the path determined by Step 2.
          6. In the Value field, paste the original error.
          7. In the Message field, enter your custom message.
          8. Test to ensure the message is being replaced.

          Set a Custom Error Message That Returns as a String

          Set a Custom Error Message for an error that returns as a string. A Custom Error Message returns based on a defined path and value. Set custom error messages for File elements, Image elements, all Action elements, and Setup.

          Before You Begin

          Before configuring Error Messages, preview the errors to determine their format.

          1. Run the Omniscript to encounter the error.
          2. Copy the text following the colon after the word Error.
          3. Open the Error Messages property in the Action Element that’s rendering the error.
          4. In the Path field, enter the path to the original error using a merge field syntax.
            For example, to reference the error message in this JSON string:
            {
               "errorMessage" : "An Error has occured in an apex class",
               "error" : "OK"
            }

            Enter errorMessage in the Path field.

            If the JSON string is more complex such as:

            {
              "errors" : [ { "errorMessage" : "An error has occured. " }]
            }

            Enter errors|0:errorMessage in the Path field.

          5. In the Value field, paste the original error.
          6. In the Message field, enter your custom message.
          7. Test to ensure the message is being replaced.
           
          Loading
          Salesforce Help | Article