Since your ListAction does not have the handler, you still need to implement handler on the server side by Row_CustomAction server event, read Page_Load -> Example 3. Note also that your posted code should be for Page_Load, not Row_CustomAction.
When you use ActionType::AJAX, you handle the result by your own success function, setting server side failure message won't work. You should return response for your success function, e.g. if your function expects data as an object, you should return an object (associative array in PHP):
$this->Response = new JsonResponse(["success" => true, "message" => "Trigger Successfully"]);
so your success function can read data.success and show the data.message.
/**
* Executes an SQL UPDATE statement on a table
*
* Table expression and columns are not escaped and are not safe for user-input.
*
* @param array<string, mixed> $data (unquoted column name as key)
* @param array<string, mixed> $criteria (unquoted column name as key)
* @param array<string, ParameterType> $types (quoted column name as key)
*
* @return int|numeric-string The number of affected rows.
*
* @throws Exception
*/
public function update(array $data, array $criteria = [], array $types = []): int|string
You better convert the $success to bool.
Your window.callActionSuccess() shown above did not handle the success/error message.
are you able to update my code for me please as i dont fully understand.
basicly i want to show the Success or Failure message and if success then refresh the page after the message