Overview

This allows you to call a ClearProcess API from within a ModeSwitcher using keys specified in the ModeSwitcher. Valid page components for this action are:

  • ModeSwitcher – the onSave property can be used

Properties

PropertyDescription
actionSet this to “apiFromKeys” to use this action.
apiThe name of the ClearProcess API to be called.
successActionsAn array of actions to be called if the API returns no error messages.
errorActionsAn array of actions to be called if the API returns error messages.

Example

Add the following to your component:

"onSave": {
  "action": "apiFromKeys",
  "api": "CreateSalesOrder",
  "successActions": [
    {
      "action": "changeMode",
      "parameters": {
        "mode": "display"
      }
    },
    {
      "name": "setIn",
       "parameters": {
         "value": {},
          "key": [
            "user_parameters"
          ]
       }
    }
  ],
  "errorActions": [
    {
      "action": "showModal",
      "name": "errorMessages"
    }
  ]
}