OnSubmitRequest - InfoPath Dev
in

InfoPath Dev

OnSubmitRequest

Last post 12-15-2006 05:57 AM by joanfuture. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-11-2006 08:03 AM

    OnSubmitRequest

    Hi,

    I want to add some code before the submit occurs so I changed my submit button from 'submit to web service' to 'custom submit using form code'. I thought I could add my code in the OnSubmitRequest event and then call thisXDocument.Submit() but I get an IP error: 'XDocument.Submit cannot be called from the XDocument::OnSubmitRequest handler'.

    So, I have two questions; where should I call the submit method from, and is that all I need to do or do I have more manual work to do since I'm not using IP's default submit?

    Thanks!
  • 01-11-2006 10:43 AM In reply to

    • sandeep
    • Not Ranked
    • Joined on 11-16-2005
    • India
    • Posts 7
    Hi sjc724

    Check out these links and I think you will find an answer:

    http://office.microsoft.com/en-us/assistance/HA012073751033.aspx
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xdevtOnSubmitRequest_HV01021370.asp


    Sandeep
    InfoPath Dev India
  • 01-11-2006 01:26 PM In reply to

    Here are the steps
    1. Add a button control.
    2. Double click on the button control and click on edit form code.
    3. Write code that you want.
    4. Now call "thisXDocument.Submit();"

    Agni
    InfoPath Dev India
  • 01-12-2006 04:26 AM In reply to

    Thank you both!
  • 12-15-2006 05:57 AM In reply to

    Hi,
    the code above did not work for me, I think it happens, when you have more than one DataConnection.

    ((DAVAdapter)thisXDocument.DataAdapters["Name of DataConnection"]).Submit();

    This code does the job for me just fine.

    hope this helps someone.
    joanfuture
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.