Solved

How do I execute InfoPath Submit Data Connection from c#

Posted on 2013-12-16
4
1,084 Views
Last Modified: 2013-12-16
I currently have four different Submit Data Connections that are implemented as Rules behind a button.

I need to execute them two different ways:
-Code behind
-Separate process, code called by a timer.



Thank in advance,
SDC00.png
SDC01.png
SDC02.png
SDC03.png
0
Comment
Question by:rezlab
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:clayfox
ID: 39721959
This post has some sample code that might be helpful.

http://www.infopathdev.com/forums/p/11836/41621.aspx#41621
0
 

Author Comment

by:rezlab
ID: 39722066
Thanks. Not quite. I am looking for something along the lines of
DataConnection fsc = DataConnections["NameOfDataConnection"];
fsc.Execute();

But I am unsure if I need to pass in parameters as noted in the images and if so how does one do that?

The other questions is can all of this be done away from InfoPath in a stand alone process?
0
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 39722125
It looks like you already have the web service fields pointed at the fields in the form schema.
Those would need to have the appropriate values set before submit, regardless of whether via code or via rules.

You can specify a specific submit date connection via code.

Unless you are just submitting the whole xml file, there would not be a way to submit it external to InfoPath.

If your process cannot be completed during the initial user session, then possibly some workflow or an admin form which would query form data from a SP list or something and then submit in bulk or whatever are other options.
0
 

Author Comment

by:rezlab
ID: 39722147
I ended up with:

WebServiceConnection wsc = (WebServiceConnection)DataConnections["Submit to Database"];
 wsc.Execute();

I guess for the second half I will just have to parse the XML and call the web services like normal, I was just hoping for a short cut.

Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question