Stop BPM Form from Closing

I have a customized BPM form that checks some logic on certain fields when OK is clicked and throws an error if data is missing. The reason I have a custom drop down is because within the BPM Data Form Designer, I cannot add a connection to a BAQ or Adapter to get the data; I would have to manually add values. So, I’m trying to require the input of that drop down and it works, except it shows the error message and then closes the BPM form. How can I prevent form from closing?
The click event has EventArgs instead of CancelEventArgs, so I cannot do args.Cancel = true (unless I’m missing something).

	catch(Exception e)
		if( e.ToString().Contains("Product") )
			MessageBox.Show("Product Group is Required", "Product Group Required", MessageBoxButtons.OK, MessageBoxIcon.Information);


Form closing event I can check for the button value and cancel there…

1 Like