<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Using Rules and Code to submit form, InfoPath prompts user to Save file when closing</title><link>https://www.infopathdev.com:443/forums/thread/107644.aspx</link><pubDate>Sun, 07 Aug 2016 15:15:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:107644</guid><dc:creator>meissen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/107644.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=107644</wfw:commentRss><description>Hi all,
&lt;br /&gt;&lt;br /&gt;
My InfoPath form needs to follow these steps when submitting:
&lt;br /&gt;&lt;br /&gt;
1. Query Form library to get max(ID) from the form library, then update &amp;quot;FileID&amp;quot; field on the InfoPath form with the file&amp;#39;s ID that it will likely have when submitted.&lt;br /&gt;
2. Submit file to Form library&lt;br /&gt;
3. Programmatically (using VB) step through 11 repeating sections and export the row information into a SharePoint list. The VB code also updates each row&amp;#39;s &amp;quot;ID&amp;quot; field with the SharePoint list&amp;#39;s record ID&lt;br /&gt;
4. Submit form again with updated record IDs in form&lt;br /&gt;
5. Ideally, close without user intervention&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
I&amp;#39;m able to accomplish 1-4 through rules and code perfectly fine, but I cannot get Step #5 to work cleanly. I&amp;#39;ve added the rule action to &amp;quot;Close form&amp;quot; but it prompts the user if they&amp;#39;d like to save the file before closing. 
&lt;br /&gt;&lt;br /&gt;
When using the regular &amp;quot;Submit&amp;quot; functionality under Submit Options (instead of using Rules and Code), InfoPath would submit the form, update the file name, and close the form without any prompts.
&lt;br /&gt;&lt;br /&gt;
Is there any way to achieve this while still using the Rules and Code option? Or, is it possible to accomplish steps #1 through 4 while still using the normal/default &amp;quot;Submit&amp;quot; functional</description></item></channel></rss>