Flag Field After Digitial Signature Changed Event - InfoPath Dev
in

InfoPath Dev

Flag Field After Digitial Signature Changed Event

Last post 11-01-2010 04:42 PM by Potemkine. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 11-01-2010 10:51 AM

    Flag Field After Digitial Signature Changed Event

    I'm sorry if this has been answered before, but please let me know where I can find the answer.

    I am trying to change a field after a signature is added to a form.

    Getting: "InvalidOperationException was unhandled by user code", "Operation is not valid, because of the current state of the object."

    Code:

    public void InternalStartup()
        {
          EventManager.XmlEvents["/my:myFields/my:signatures1/my:signatures2"].Changed += new XmlChangedEventHandler(signatures2_Changed);
        }  
    
        public void signatures2_Changed(object sender, XmlEventArgs e)
        {
          // Write your code here to change the main data source.
          XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
          // MessageBox.Show(xnDoc.OuterXml.ToString(), "Main Data Source XML");      
          XPathNavigator field1 = xnDoc.SelectSingleNode("/my:myFields/my:field1", this.NamespaceManager);
          if (field1.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance")) 
            field1.DeleteSelf();      
          field1.SetValue("true");
          xnDoc = null;
          field1 = null;
    

    Thanks in advance.

  • 11-01-2010 11:16 AM In reply to

    Re: Flag Field After Digitial Signature Changed Event

    Hi, do you have enabled signature on all the form or just on specific data group?

    If your field is on a sign data block, you can't modify it because if you do that your signature will be invalid. You can create a new 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't suggest you to do that, you're old form will not open because of the xml structure is not the same that your new template.

  • 11-01-2010 11:43 AM In reply to

    Re: Flag Field After Digitial Signature Changed Event

    Thank you for your response.  

    I am trying to sign a section, not the entire form. The field is on the form, not the section that is being signed.

     

     

  • 11-01-2010 11:58 AM In reply to

    Re: Flag Field After Digitial Signature Changed Event

    Ok, how do you create your event handler ? I think you create it with the field signature that's why you can't modify some field. I suggest you to create a new event on sign and try your code on it.

  • 11-01-2010 12:31 PM In reply to

    Re: Flag Field After Digitial Signature Changed Event

    I'm sorry if this sounds like a dumb question, but I am just learing how to program.

    I was under the impression that for a browser enabled form, I was only able to use the Changed and Validating events.

    Please let me know if I'm wrong. Thank you for the time.

  • 11-01-2010 12:42 PM In reply to

    Re: Flag Field After Digitial Signature Changed Event

    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 on the submit and modify your field consequently.

  • 11-01-2010 02:12 PM In reply to

    Re: Flag Field After Digitial Signature Changed Event

    Is it possible if I am submitting to a SharePoint library.

    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.

    Example:

    Group 1: signed

    Group 2: not signed

    Group 3: signed

    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.

    I have found this code, but I'm having problems with the boolean value and can't seem to get it to work.

    if(e.Operation == XmlOperation.Insert)

    booleanValue = true;

    if (e.Operation == XmlOperation.Delete)

    booleanValue = false;

    xnDoc = null;

    field1 = null;

  • 11-01-2010 04:42 PM In reply to

    Re: Flag Field After Digitial Signature Changed Event

    Hi, why you don't create a button to sign your form with that, you can easily modify other field on your form.

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.