Hi,
I have a InfoPath 2007 form which is published as a web form in SharePoint. It is submitted programatically using custom code. This works fine, except in the case that there are validation error with the form. If there are errors, the following message is shown:
An error occurred while the form was being submitted.
The submit event handler returned a value indicating that the submit failed.
In my submit handler I have the followig:
if (this.Errors.Count == 0)
{
//do submit here
e.CancelableArgs.Cancel = false
}
else
{
e.CancelableArgs.Cancel = true;
}
Setting e.CancelableArgs.Cancel = true seems not to be stopping forms services from attempting to submit the form, and so the error is shown.
Has anyone got an idea on how to ensure the form is valid before it is submitted, or cancel submission in a submit handler properly?
Thanks,
Craig