<?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: need custom submit code sample/example</title><link>https://www.infopathdev.com:443/forums/thread/46657.aspx</link><pubDate>Sat, 05 Sep 2009 04:06:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:46657</guid><dc:creator>princevis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/46657.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=46657</wfw:commentRss><description>&lt;p&gt;On button_click event,write this code..&amp;nbsp;&lt;/p&gt;
&lt;p&gt;SPSecurity.RunWithElevatedPrivileges(delegate() &lt;/p&gt;
&lt;p&gt;{ this.Submit();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;});&lt;/p&gt;
&lt;p&gt;place a hidden field in an infopath form that can be a check box,in properties of butto dialog box,change it&amp;#39;s value to true. And write a SPD workflow to send an email when that value is send to true.&lt;/p&gt;
&lt;p&gt;I think u got my ponit..&lt;/p&gt;</description></item><item><title>Re: need custom submit code sample/example</title><link>https://www.infopathdev.com:443/forums/thread/40368.aspx</link><pubDate>Mon, 06 Apr 2009 19:14:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40368</guid><dc:creator>christian_bahnsen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40368.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40368</wfw:commentRss><description>&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;XDocument.Submit presumes you&amp;#39;ve defined a data connection for&amp;nbsp;submit , correct?&lt;/p&gt;
&lt;p&gt;As a test I created a simple form with an email submit button, then defined the data connection.&amp;nbsp; (By the way, such data connections aren&amp;#39;t viewable&amp;nbsp;as a data source, per se, are they?)&lt;/p&gt;
&lt;p&gt;I extracted the form files and looked in manifest.xsf, finding:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;lt;xsf:submit caption=&amp;quot;Su&amp;amp;amp;bmit&amp;quot; disableMenuItem=&amp;quot;no&amp;quot; onAfterSubmit=&amp;quot;keepOpen&amp;quot; showStatusDialog=&amp;quot;yes&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:emailAdapter name=&amp;quot;chris_email&amp;quot; submitAllowed=&amp;quot;yes&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:to value=&amp;quot;&lt;a href="mailto:christian.bahnsen@xxxx"&gt;christian.bahnsen@xxxx&lt;/a&gt;&amp;quot; valueType=&amp;quot;literal&amp;quot;&amp;gt;&amp;lt;/xsf:to&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:intro value=&amp;quot;This message was created by a Microsoft Office InfoPath form. The form data may be included as an attachment.&amp;quot;&amp;gt;&amp;lt;/xsf:intro&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:attachmentFileName value=&amp;quot;Form&amp;quot; valueType=&amp;quot;literal&amp;quot;&amp;gt;&amp;lt;/xsf:attachmentFileName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/xsf:emailAdapter&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/xsf:submit&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Can these xsf properties be set programmatically?&amp;nbsp; This would give me the flexibility to define an adapter on the fly.&lt;/p&gt;
&lt;p&gt;If I define multiple xsf:emailAdapters, is there a way to specify which adapter to use?&amp;nbsp; This would give me the flexiblilty to choose from pre-defined adapters.&lt;/p&gt;
&lt;p&gt;Are XPathTypedValue and/or EmailSubmitConnection going to be of any help, or are they more oriented toward Visual Studio use rather than in InfoPath jscript or vbscript?&lt;/p&gt;
&lt;p&gt;Sorry to pepper you with so many questions.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: need custom submit code sample/example</title><link>https://www.infopathdev.com:443/forums/thread/40338.aspx</link><pubDate>Sun, 05 Apr 2009 15:39:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40338</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40338.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40338</wfw:commentRss><description>&lt;p&gt;In JScript, you can invoke the main submit adapter with:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;XDocument.Submit();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I believe in VBScript it would be the same without the parentheses and semicolon.&lt;/p&gt;</description></item><item><title>need custom submit code sample/example</title><link>https://www.infopathdev.com:443/forums/thread/40337.aspx</link><pubDate>Sun, 05 Apr 2009 15:17:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40337</guid><dc:creator>christian_bahnsen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40337.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40337</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m new to InfoPath.&amp;nbsp; Can someone post some sample code for submit.&amp;nbsp; My immediate interest is in code to handle email submission.&lt;/p&gt;
&lt;p&gt;Or is there a way to view the code associated with a normal submit button?&amp;nbsp; A normal submit button to an email address doesn&amp;#39;t seem to generate any script code, or at least I couldn&amp;#39;t find it in the Microsoft Script Editor.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve written custom code (attached to the onclick event for a button on the form) to validate user input in various fields.&amp;nbsp; It&amp;#39;s working fine.&amp;nbsp; But if I can move that code over into custom code for a submit button I won&amp;#39;t need two buttons on the form.&amp;nbsp; If the code finds any problems it will alert the user and stop; otherwise it will continue on and submit the data.&lt;/p&gt;
&lt;p&gt;Again, I need some examples of code that submits to email.&lt;/p&gt;
&lt;p&gt;Thanks in advance for any help.&lt;/p&gt;</description></item></channel></rss>