<?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: Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60974.aspx</link><pubDate>Mon, 01 Nov 2010 23:42:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60974</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60974.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60974</wfw:commentRss><description>&lt;p&gt;Hi, why you don&amp;#39;t create a button to sign your form with that, you can easily modify other field on your form.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60972.aspx</link><pubDate>Mon, 01 Nov 2010 21:12:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60972</guid><dc:creator>ghurley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60972.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60972</wfw:commentRss><description>&lt;p&gt;Is it possible if I am submitting to a SharePoint library.&lt;/p&gt;
&lt;p&gt;I have a form that needs to be signed by someone from 5 different groups. I am trying to promote some information into SharePoint about if a group has signed the document or not. &lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;Group 1: signed&lt;/p&gt;
&lt;p&gt;Group 2: not signed&lt;/p&gt;
&lt;p&gt;Group 3: signed&lt;/p&gt;
&lt;p&gt;Each group will have a different section on the form to sign and I would like for a hidden check box to chck / uncheck as a signature is added or removed.&lt;/p&gt;
&lt;p&gt;I have found this code, but I&amp;#39;m having problems with the boolean value and can&amp;#39;t seem to get it to work. &lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(e.Operation == &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlOperation&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Insert) &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;booleanValue = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (e.Operation == &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlOperation&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Delete)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;booleanValue = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;false&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;xnDoc = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;field1 = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60967.aspx</link><pubDate>Mon, 01 Nov 2010 19:42:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60967</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60967.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60967</wfw:commentRss><description>&lt;p&gt;As you might be aware, the Sign event is not available on InfoPath Forms Services. Why do you use this flag ? Perhaps you can do some check if your form is sign or not&amp;nbsp;on the submit and modify your field consequently.&lt;/p&gt;</description></item><item><title>Re: Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60966.aspx</link><pubDate>Mon, 01 Nov 2010 19:31:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60966</guid><dc:creator>ghurley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60966.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60966</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m sorry if this sounds like a dumb question, but I am just learing how to program.&lt;/p&gt;
&lt;p&gt;I was under the impression that for a browser enabled form, I was only able to use the Changed and Validating events. &lt;/p&gt;
&lt;p&gt;Please let me know if I&amp;#39;m wrong. Thank you for the time. &lt;/p&gt;</description></item><item><title>Re: Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60965.aspx</link><pubDate>Mon, 01 Nov 2010 18:58:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60965</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60965.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60965</wfw:commentRss><description>&lt;p&gt;Ok, how do you create your event handler ? I think you create it with the field signature that&amp;#39;s why you can&amp;#39;t modify some field. I suggest you to create a new event on sign and try your code on it.&lt;/p&gt;</description></item><item><title>Re: Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60964.aspx</link><pubDate>Mon, 01 Nov 2010 18:43:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60964</guid><dc:creator>ghurley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60964.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60964</wfw:commentRss><description>&lt;p&gt;Thank you for your response.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am trying to sign a section, not the entire form. The field is on the form, not the section that is being signed. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60963.aspx</link><pubDate>Mon, 01 Nov 2010 18:16:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60963</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60963.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60963</wfw:commentRss><description>&lt;p&gt;Hi, do you have enabled signature on all the form or just on specific data&amp;nbsp;group? &lt;/p&gt;
&lt;p&gt;If your field is on a sign data&amp;nbsp;block, you can&amp;#39;t modify it because if you do&amp;nbsp;that your signature will be invalid. You can create a new&amp;nbsp;field on a data block that is not sign or deplace your current field to another xml location but if you have lots of form create with that template, I don&amp;#39;t suggest you to do that, you&amp;#39;re old form will not open because of the xml structure is not the same that your new template.&lt;/p&gt;</description></item><item><title>Flag Field After Digitial Signature Changed Event</title><link>https://www.infopathdev.com:443/forums/thread/60961.aspx</link><pubDate>Mon, 01 Nov 2010 17:51:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60961</guid><dc:creator>ghurley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60961.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60961</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m sorry if this has been answered before, but please let me know where I can find the answer.&lt;/p&gt;
&lt;p&gt;I am trying to change a field after a signature is added to a form.&lt;/p&gt;
&lt;p&gt;Getting: &amp;quot;InvalidOperationException was unhandled by user code&amp;quot;, &amp;quot;Operation is not valid, because of the current state of the object.&amp;quot;&lt;/p&gt;
&lt;p&gt;Code:&lt;/p&gt;
&lt;div style="BACKGROUND-COLOR:white;COLOR:black;"&gt;&lt;pre&gt;&lt;span style="COLOR:blue;"&gt;public&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;void&lt;/span&gt; InternalStartup()
    {
      EventManager.XmlEvents[&lt;span style="COLOR:#a31515;"&gt;&amp;quot;/my:myFields/my:signatures1/my:signatures2&amp;quot;&lt;/span&gt;].Changed += &lt;span style="COLOR:blue;"&gt;new&lt;/span&gt; XmlChangedEventHandler(signatures2_Changed);
    }  

    &lt;span style="COLOR:blue;"&gt;public&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;void&lt;/span&gt; signatures2_Changed(&lt;span style="COLOR:blue;"&gt;object&lt;/span&gt; sender, XmlEventArgs e)
    {
      &lt;span style="COLOR:green;"&gt;// Write your code here to change the main data source.&lt;/span&gt;
      XPathNavigator xnDoc = &lt;span style="COLOR:blue;"&gt;this&lt;/span&gt;.MainDataSource.CreateNavigator();
      &lt;span style="COLOR:green;"&gt;// MessageBox.Show(xnDoc.OuterXml.ToString(), &amp;quot;Main Data Source XML&amp;quot;);      &lt;/span&gt;
      XPathNavigator field1 = xnDoc.SelectSingleNode(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;/my:myFields/my:field1&amp;quot;&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;this&lt;/span&gt;.NamespaceManager);
      &lt;span style="COLOR:blue;"&gt;if&lt;/span&gt; (field1.MoveToAttribute(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;nil&amp;quot;&lt;/span&gt;, &lt;span style="COLOR:#a31515;"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt;)) 
        field1.DeleteSelf();      
      field1.SetValue(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;);
      xnDoc = &lt;span style="COLOR:blue;"&gt;null&lt;/span&gt;;
      field1 = &lt;span style="COLOR:blue;"&gt;null&lt;/span&gt;;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item></channel></rss>