Solved

How do I execute InfoPath Submit Data Connection from c#

Posted on 2013-12-16
4
1,056 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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