DataAdapters["..."].Submit(); works in 2003 but not in 2007 - InfoPath Dev
in

InfoPath Dev

DataAdapters["..."].Submit(); works in 2003 but not in 2007

Last post 08-24-2009 10:05 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-20-2009 08:09 AM

    • admot
    • Top 500 Contributor
      Male
    • Joined on 08-09-2006
    • USA
    • Posts 51

    DataAdapters["..."].Submit(); works in 2003 but not in 2007

     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.
  • 08-24-2009 10:05 AM In reply to

    Re: DataAdapters["..."].Submit(); works in 2003 but not in 2007

    I think you can use e.ToString() to get the stack trace... at least that's what I'd do in C#.

    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.