<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: OnSubmitRequest() and web service submission</title><link>https://www.infopathdev.com:443/forums/thread/13939.aspx</link><pubDate>Tue, 08 Nov 2005 05:11:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13939</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13939.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13939</wfw:commentRss><description>I have heard from sources that the next version will be integrated in VS!  I agree that the code editor can use improvement but looks like they are on the way to fix that.</description></item><item><title>Re: OnSubmitRequest() and web service submission</title><link>https://www.infopathdev.com:443/forums/thread/13938.aspx</link><pubDate>Tue, 08 Nov 2005 04:15:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13938</guid><dc:creator>DavidCrabbe</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13938.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13938</wfw:commentRss><description>Thanks again, I appreciate your help.&lt;br /&gt;&lt;br /&gt;K2 is good - although it'd be great if they'd integrate more fully with Visual Studio, the IDE is a little basic for code dev. But I'm picky. :)</description></item><item><title>Re: OnSubmitRequest() and web service submission</title><link>https://www.infopathdev.com:443/forums/thread/13937.aspx</link><pubDate>Tue, 08 Nov 2005 03:56:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13937</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13937.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13937</wfw:commentRss><description>I was not intending to be sarcastic.  I edited my comment :-)  I have so many positive things to say about the software.  K2 provides a generic framework with simple easy integration with BizTalk, InfoPath, ASP.net, SharePoint ... and soon WinForms.  I did a large gov't contract for 3 years writing a custom workflow application in C# and it took forever.  Wish we had this product at the time.&lt;br /&gt;&lt;br /&gt;No problem.  I live to serve and to be a "workflow junkie"...</description></item><item><title>Re: OnSubmitRequest() and web service submission</title><link>https://www.infopathdev.com:443/forums/thread/13936.aspx</link><pubDate>Tue, 08 Nov 2005 03:43:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13936</guid><dc:creator>DavidCrabbe</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13936.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13936</wfw:commentRss><description>Thanks for your quick reply.  Nice idea - although I'm not entirely sure if you're being sarcastic with the last comment on K2. ;)&lt;br /&gt;&lt;br /&gt;I'm not actually using the task pane, instead I'm using a button on my form that when set to 'Submit' action works fine for submitting to K2 - as long as you don't want OnSubmitRequest() to run.&lt;br /&gt;&lt;br /&gt;Since posting, I've found that if I use any web service to submit my form then OnSubmitRequest() isn't called. Either it's only used for code-based submission or I've stuffed up somewhere.&lt;br /&gt;&lt;br /&gt;Anyway - I've tried the approach of having an event handler for my button that calls ValidateForm(), basically the same content as my original OnSubmitRequest() but called explicitly, which takes care of any custom validation.  If that succeeds I call the thisXDocument.Submit() method and catch any errors that may be thrown.&lt;br /&gt;&lt;br /&gt;This seems to work fine, although I reserve the right to post again on this topic when I find I've missed something. :o)</description></item><item><title>Re: OnSubmitRequest() and web service submission</title><link>https://www.infopathdev.com:443/forums/thread/13935.aspx</link><pubDate>Tue, 08 Nov 2005 02:58:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13935</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13935.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13935</wfw:commentRss><description>Not sure if anyone else has used K2 extensively on this forum.  Luckily I have.&lt;br /&gt;&lt;br /&gt;I found this to be an issue as well.  It sounds like you have some of your own custom code, so K2 forced you down the path of using a custom task pane to submit.  Correct?&lt;br /&gt;&lt;br /&gt;This is what we did.  On the K2 server there is a directory called C:\Program Files\K2.net 2003\Bin\Temp\IPResourceFiles.  In that directory there are the files that K2 shoves into InfoPath, specifically the k2 custom task pane (taskpane_new.htm).  If you jump into the code, you will see there is a submit to thier webservice.  What we did was place methods around that submit call that have to be implemented on the InfoPath form.   We did something like:&lt;br /&gt;&lt;br /&gt;if (window.external.Window.XDocument.Extension.CanSubmit()) {&lt;br /&gt;    window.external.Window.XDocument.Extension.BeforeSubmit();&lt;br /&gt;    gobjXDocument.Submit();&lt;br /&gt;    window.external.Window.XDocument.Extension.AfterSubmit();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Once you make this change, you will need to refresh your InfoPath form with the K2 process by right clicking the process.  Now you will need to implement these methods on EVERY InfoPath form that is exported to that server.&lt;br /&gt;&lt;br /&gt;Now all you need to do is call your validation fuction inside of CanSubmit() inside of InfoPath.&lt;br /&gt;&lt;br /&gt;The nice thing about doing this is that all of your forms will have a consistent approach to handling the K2 submission.  So if you have future forms that may not the same type of validation model, you can simply just return true and you are done.&lt;br /&gt;&lt;br /&gt;I did not use the OnSubmitRequest() but I think moving the code to this new method should do the trick.  Hope this helps.&lt;br /&gt;&lt;br /&gt;Isn't K2 GREAT tool.  I have loved working with it thus far.</description></item><item><title>OnSubmitRequest() and web service submission</title><link>https://www.infopathdev.com:443/forums/thread/12665.aspx</link><pubDate>Tue, 08 Nov 2005 02:25:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12665</guid><dc:creator>DavidCrabbe</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12665.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12665</wfw:commentRss><description>I'm integrating my InfoPath form with a K2.net workflow and I'm having difficulty with the OnSubmitRequest() event handler.&lt;br /&gt;&lt;br /&gt;Prior to integration with K2.net, it doesn't matter if I set a button to a 'Submit' action, or to 'Rules and Custom Code' and call thisXDocument.Submit() within the button's event handler, either way OnSubmitRequest() is called. &lt;br /&gt;&lt;br /&gt;After integration, there doesn't appear to be any way in which I can get OnSubmitRequest() to be called. If I set my button to the 'Submit' action it calls the K2.net web service and the form is submitted without calling OnSubmitRequest(). If I set my button to 'Rules and Custom Code' then the event handler for the button is called, the form is submitted but again OnSubmitRequest() is never reached. &lt;br /&gt;&lt;br /&gt;I'm wondering if the behaviour described above is a peculiarity of K2.net or common for submission by web service?  Has anyone used OnSubmitRequest() in conjunction with a web service submission process?  Surely it's not uncommon...&lt;br /&gt;&lt;br /&gt;FYI OnSubmitRequest() is required to do some custom validation before the form is submitted - I guess I could move the code elsewhere but I'm hoping I don't have to.</description></item></channel></rss>