Solved

How do I execute InfoPath Submit Data Connection from c#

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
asp.net mvc5 3 38
How Can I fix my MouseHover Event? 14 27
Expando 4 34
Closing all open child forms. 4 23
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now