Exception Handling for Data Form Closing

Hey mega-minds! I’ve got a dashboard that triggers a Method Directive with a button click event. The button method has a GetNewProject() call. This calls to a directive that opens a BPM Data Form where users can add a few details for the new project. But, if the user closes that data form without clicking the OK button (clicking the X), we get the “Cancelled by User” message that kills the whole process.

My problem is that I disable the button once it’s clicked to prevent the user from clicking multiple times due to lag, and once the process is “Cancelled by User” the dashboard code stops before enabling the button.

Now, my question: is there a way to catch this directive exception in the dashboard code or a setting in the directive itself that will prevent it from stopping the whole process?

Thank you for your time and any help you can provide!

Short answer… no. Don’t let the users close out of the form, give them a Cancel button and handle that logic yourself

1 Like

Thank you @josecgomez! I will add a cancel button to our data forms. But, is there a way to prevent the form from being closed out by the X? I’ve seen a few posts about using the forms Closing event with something like Args.Cancel = true. I’ve tried that, but the form closes anyway.

You could try to hide the ControlBox on the customization to the BPM Form

IP_InvalidCharacterForm.ControlBox=false;

image

1 Like

Alt-F4?

Luckily, I don’t think that most of our users are that clever. LOL

I was told I was clever once, :rofl: