Hello everyone:
I'm visiting again the issue of using Code and how it supercedes the error trapping built into InfoPath. I have to use Code to use the Application.ActiveWindow.Close(true) function so InfoPath closes once the form is submitted. With that said, if I have the submit data connection set to not allow overwrite, InfoPath gives the user a JavaScript error message if they're trying to overwrite the form. How to I intercept that condition and present a message telling the user they've already submitted the form?
Currently, my code looks like this:
{
if (XDocument.Errors.Count > 0)
{
XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).")
return;
}
XDocument.Submit()
Application.ActiveWindow.Close(true);
}
Thanks!
Deb