<?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>InfoPath</title><link>https://www.infopathdev.com:443/forums/170.aspx</link><description>For questions on using InfoPath in Office 365</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Display Validation Error Summary in InfoPath 2013</title><link>https://www.infopathdev.com:443/forums/thread/118107.aspx</link><pubDate>Mon, 15 Jan 2018 15:51:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:118107</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/118107.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=170&amp;PostID=118107</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Is this working for you? If so, I think its fine. :)&lt;/p&gt;</description></item><item><title>Re: Display Validation Error Summary in InfoPath 2013</title><link>https://www.infopathdev.com:443/forums/thread/118099.aspx</link><pubDate>Sat, 13 Jan 2018 11:18:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:118099</guid><dc:creator>earlgerald</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/118099.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=170&amp;PostID=118099</wfw:commentRss><description>Hi Hilary,

What do you think about this code below:

public void CTRL2_5_Clicked(object sender, ClickedEventArgs e)
        {
            // Write your code here.
            FormErrorCollection myFormErrors = Errors;
            XPathNavigator mytxtbox = MainDataSource.CreateNavigator();
            mytxtbox = mytxtbox.SelectSingleNode(&amp;quot;/my:myFields/my:frmError&amp;quot;, NamespaceManager);
            int formErrors = Errors.Count;
            if (formErrors &amp;gt; 0) mytxtbox.SetValue(&amp;quot;disabled&amp;quot;);
            else mytxtbox.SetValue(&amp;quot;enabled&amp;quot;);
            {
                MessageBox.Show(&amp;quot;Number of errors: &amp;quot; + Errors.Count);
                string errors = string.Empty;
                foreach (FormError err in Errors)
                {
                    errors += &amp;quot;&amp;quot; + err.Message
                    + System.Environment.NewLine;
                }
                MessageBox.Show(&amp;quot;Fill out required fields: &amp;quot;
                + System.Environment.NewLine + errors + System.Environment.NewLine + &amp;quot;Hint: Press Ctrl+Shift+O&amp;quot;);
            }
        }

Thanks,
Earl</description></item><item><title>Re: Display Validation Error Summary in InfoPath 2013</title><link>https://www.infopathdev.com:443/forums/thread/118078.aspx</link><pubDate>Fri, 12 Jan 2018 17:49:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:118078</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/118078.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=170&amp;PostID=118078</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;a href="https://msdn.microsoft.com/en-us/library/office/microsoft.office.infopath.formerrorcollection.aspx"&gt;https://msdn.microsoft.com/en-us/library/office/microsoft.office.infopath.formerrorcollection.aspx&lt;/a&gt;&amp;nbsp;has some sample code.&lt;/p&gt;</description></item><item><title>Display Validation Error Summary in InfoPath 2013</title><link>https://www.infopathdev.com:443/forums/thread/118076.aspx</link><pubDate>Fri, 12 Jan 2018 16:52:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:118076</guid><dc:creator>earlgerald</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/118076.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=170&amp;PostID=118076</wfw:commentRss><description>I&amp;#39;m trying to use &amp;quot;Check for Errors&amp;quot; button with code behind to display validation errors in InfoPath 2013.

This code below worked in the previous versions.  Does anyone know how to apply this code to work in InfoPath 2013 or newer using C#?


function CTRL348_5::OnClick(eventObj)
{
                // Write your code here
                var error; 
                error = XDocument.Errors.Count; 
                if(error != 0) XDocument.UI.Alert(&amp;quot;You have not filled in all of the required fields or have invalid data/incorrect format!\n\n\t\tNumber of fields with errors: &amp;quot; + XDocument.Errors.Count + &amp;quot;\n\n[ HINT: to jump to the field with errors, after clicking on OK, press CTRL+SHIFT+O ]&amp;quot;);
                if(error == 0) XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:frmError&amp;quot;).text = &amp;quot;enabled&amp;quot;;
}</description></item></channel></rss>