Hi!
I created an .xsn form in IP 2003. I have the submit button using custom code for various reasons. When the user clicks the submit button, they can either submit or cancel. Below is the jscript code I used.
function XDocument::OnSubmitRequest(eventObj)
{
eventObj.ReturnStatus = true; try
{
// Open data connection to send email.
XDocument.DataAdapters["ExtranetSubmit"].Submit();
XDocument.UI.Alert("The form was submitted successfully.");
// Setting ActiveWindow.Close to true will close InfoPath immediately.
// Setting to false prompts to save the form.
// Tried several ways to save prior to submit i.e., xDocument.SaveAs, WshShell.SendKeys("^(p)"), etc.
// however, none seem to work prior to submitting.
// This can be resolved in InfoPath 2007 and C#.
Application.ActiveWindow.Close(false);
}
catch(e)
{
XDocument.UI.Alert("The form has not been submitted due to the user cancelling the request.");
}
}
}
This works fine in IP 2003 w/ Outlook 2003. But a user with IP 2007
with Outlook 2003 gets the "The form has not been submitted due to the
user cancelling..." message immediately after clicking the submit button. It seems to catch an error.
Questions:
1) Is there an issue w/ IP 2007 using DataAdapters? My research says it should work fine.
2) Is there a way to find out what the exact error is?
Thanks!
Don't grow old regretting the things you didn't do.