<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Reset data fields</title><link>https://www.infopathdev.com:443/forums/thread/38104.aspx</link><pubDate>Thu, 05 Feb 2009 10:33:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38104</guid><dc:creator>Vedran</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38104.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38104</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Hilary Stoupa:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Well, and that is part of the problem with the &amp;#39;New Record&amp;#39; button -- can&amp;#39;t add any other actions to it. But, in general, you can add either a field to your main data source or add a secondary data connection to an XML file and then set a value in that field that you can base your conditional formatting on -- for example, set a field to true() on a button click and have a section set to show or hide if the field is equal to true().&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s&amp;nbsp;the problem if I take &amp;quot;Conditional formatting approach&amp;quot;:&amp;nbsp; if I go to the Add New view first it works ok.&amp;nbsp; If I run any query, then try to go to the Add New view, the Add New view opens with all the data from the query, one item after another. As you can see, the problem with populated fields remains. :(&lt;/p&gt;
&lt;p&gt;Is it possible to make new form just for entering a new record and merge it with existing one?&lt;/p&gt;</description></item><item><title>Re: Reset data fields</title><link>https://www.infopathdev.com:443/forums/thread/38087.aspx</link><pubDate>Wed, 04 Feb 2009 21:41:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38087</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38087.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38087</wfw:commentRss><description>&lt;p&gt;Well, and that is part of the problem with the &amp;#39;New Record&amp;#39; button -- can&amp;#39;t add any other actions to it. But, in general, you can add either a field to your main data source or add a secondary data connection to an XML file and then set a value in that field that you can base your conditional formatting on -- for example, set a field to true() on a button click and have a section set to show or hide if the field is equal to true().&lt;/p&gt;
&lt;p&gt;Definitely you can switch views in code (C#):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;this.ViewInfos.SwitchView(&amp;quot;&lt;span style="FONT-WEIGHT:bold;FONT-FAMILY:courier new;"&gt;name of view&lt;/span&gt;&lt;/font&gt;&lt;span style="FONT-FAMILY:courier new;"&gt;&amp;quot;);&lt;/span&gt; &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To replicate the New Record, though... I think what you&amp;#39;d need to do is remove all the repeating groups in your data source, then create a new blank one (cloning from sampledata.xml works well....). This would give you a single, blank group. However, I&amp;#39;m not certain what all the New Record action does, so you would want to carefully test Submit and so forth if you take that route...&lt;/p&gt;</description></item><item><title>Re: Reset data fields</title><link>https://www.infopathdev.com:443/forums/thread/38078.aspx</link><pubDate>Wed, 04 Feb 2009 16:01:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38078</guid><dc:creator>Vedran</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38078.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38078</wfw:commentRss><description>&lt;p&gt;That is one way to go. Thanks for advice. One question pops in my head right away, how can I define that one section becomes visible if a button in clicked?&lt;/p&gt;
&lt;p&gt;Back to the problem... I&amp;#39;m interested in writing a code behind button that will switch view and reset fields. Is that possible?&lt;/p&gt;</description></item><item><title>Re: Reset data fields</title><link>https://www.infopathdev.com:443/forums/thread/38077.aspx</link><pubDate>Wed, 04 Feb 2009 15:50:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38077</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38077.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38077</wfw:commentRss><description>&lt;p&gt;I just created a new database bound form template, and a New Record button is included by default. That button has an action of &amp;#39;New Record&amp;#39;, which I believe will do what you want. However, that won&amp;#39;t allow you to also switch views.... I wonder if instead of using different views, if you might be able to use conditionally formatted sections to provide the same effect without needing to switch views? Then you could use the New Record action....&lt;/p&gt;</description></item><item><title>Reset data fields</title><link>https://www.infopathdev.com:443/forums/thread/38068.aspx</link><pubDate>Wed, 04 Feb 2009 14:10:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38068</guid><dc:creator>Vedran</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38068.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38068</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have made custom form and logic is this...&amp;nbsp;I have three views: &amp;quot;Main&amp;quot;, &amp;quot;Detail&amp;quot; and &amp;quot;New Record&amp;quot; views. On my &amp;quot;Main View&amp;quot; I have query fields and 2 data fileds (Title and Status). Additionaly I put a &amp;quot;See-details&amp;quot; button which opens a Detail view. Also, I have a &amp;quot;Add new&amp;nbsp;record&amp;quot; button which function is to switch to New Record view and open empyt data fields that can be filled.&lt;/p&gt;
&lt;p&gt;The problem is when I query for something and after click on &amp;quot;Add new record&amp;quot; the fields are populated with entries that were returned by the previous&amp;nbsp;query.&lt;/p&gt;
&lt;p&gt;I tried to run some bogus query (query that returns nothing), but then there are no fields showing.&lt;/p&gt;
&lt;p&gt;Is there any way to reset the data fields? To clarify things more, I need fields to be&amp;nbsp;as when first opening the form.&lt;/p&gt;</description></item></channel></rss>