Overview

By far the most used action in ClearWork, this allows you to call a Clear API using values from fields on the page and static values. Valid page components for this action are:

  • Input – the onBlur property can be used to trigger this action.
  • Tab – the onClick property can be used to trigger this action.
  • ActionButton – the onClick property can be used to trigger this action.
  • Page – the willMountActions property can be used to trigger this action.
  • ModeSwitcher – the onSave and onCancel properties can be used to trigger this action.
  • RpcForm – the submitActions property can be used to trigger this action.

Properties

PropertyDescription
actionNameSet this to “apiAction” to use this action.
apiThe name of the ClearProcess API to be called.
dynamicParametersValues from the page that should be passed.
parametersStatic values that should be passed regardless of the content on the page.
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:

"onClick": {
  "actionName": "apiAction",
  "api": "GetAttachments",
  "dynamicParameters": {
    "CUSTOMER": [
      "payload",
      "GetCustomer",
      "HEADER",
      "KUNNR"
    ]
  },
  "parameters": {
    "TYPE": "KNA1"
  },
  "successActions": [
    {
      "action": "hideModal",
      "name": "searchCustomers"
    }
  ],
  "errorActions": [
    {
      "action": "showModal",
      "name": "errorMessages"
    }
  ]
}