<?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: Calling onSaveRequest function</title><link>https://www.infopathdev.com:443/forums/thread/14668.aspx</link><pubDate>Sun, 25 Jun 2006 08:36:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14668</guid><dc:creator>Anonymous</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14668.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14668</wfw:commentRss><description>&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;I then want the XDocument.onSaveRequest function to be called &lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;&lt;br /&gt;I don't think you can 'call' this function because OnSaveRequest is an event.&lt;br /&gt;&lt;br /&gt;Perhaps all you need to add to your button's procedure to save the form is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;XDocument.SaveAs("C:\MyForm.xml");&lt;/pre&gt;</description></item><item><title>Calling onSaveRequest function</title><link>https://www.infopathdev.com:443/forums/thread/12902.aspx</link><pubDate>Fri, 16 Jun 2006 07:32:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12902</guid><dc:creator>spudy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12902.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12902</wfw:commentRss><description>I have written code under XDocument::onSaveRequest that works well in creating folders and the filename dependant on fields in the form.&lt;br /&gt;&lt;br /&gt;This is fine whenever user wishes to save the form. My problem relates to the 'submission' of this form. This 'submission' is merely saving the form to a different location (as we have an legacy system that will pick it up automatically).&lt;br /&gt;&lt;br /&gt;In order to manage this, when my submit button is created, it sets a variable value to 1, I then want the XDocument.onSaveRequest function to be called which has an if..statement looking for the variable set by submission. If present it saves the file to a different location.&lt;br /&gt;&lt;br /&gt;Perhaps there is an easier way of managing this?&lt;br /&gt;&lt;br /&gt;Many Thanks&lt;br /&gt;&lt;br /&gt;Paul</description></item></channel></rss>