evt.submitPrevented = true - any way to hide the default warning?


#1

Hello,

When I execute the evt.submitPrevented = true code, I would like to hide the default notification: The process could not be started. :camForm submission prevented
Is there a way to do it without hacking into the Task List js files?

Thanks and kind regards,
Deniss


#2

Hi Deniss,

there is an open JIRA-issue for that: https://app.camunda.com/jira/browse/CAM-7550

In the meantime, you can use the following code in your embedded form to automatically remove the notification after it is shown:

inject(['Notifications', '$timeout', function(Notifications, $timeout) {
  camForm.on('submit', function(evt) {
    evt.submitPrevented = true;
    $timeout(function() {
      Notifications.clearAll();
    });
  });
}]);

Does that help you?

Cheers
Sebastian


#3

Hi @sebastian.stamm,

Thanks! Works good! :slight_smile:

Kind regards,
Deniss


#4

I still experience this in start forms, although the above mentioned issue has been fixed.

Is there a way to display a custom error message?