Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How do I execute InfoPath Submit Data Connection from c#

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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