Handle Error Messages
  • 16 Apr 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Handle Error Messages

  • Dark
    Light

Article summary


Handle Error Messages

You can implement code to manage error messages for custom code. This article gives you information about how.


Clear Error messages

To clear a users' error messages, you use the following code:

processData.getDialogWorkspace().getErrorService().clearAllErrors(processData.getDialogWorkspace().getName());

Message with requirement to confirm by checkbox

To require the user to confirm the message (by checking the checkbox), code something like this:


// Check that all dialogs are closed

        if (sessionWorkspace.getNavigator().getActiveWorkspaces().size() > 1) {

            ApplicationError error = new ApplicationError("CABASE", "this.action.will.close.all.active.tasks");

            error.setKey(dialogWorkspace.getName());

            error.setConfirmationKey("this.action.will.close.all.active.tasks");

            if (!errorService.addError(error)) {

                processData.setAbort(true);

                return false;

            } else {

                errorService.clearAllErrors(dialogWorkspace.getName());

            }

        }

        



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.