Using Code To "Save"


  • I have a form where users can "Save" then later "Submit". I want "Submit" to simply set a "Submitted" boolean field to "TRUE", then perform a normal save.

    The InfoPath form uses code to do various things, and I currently have it set up to run custom code for "Submit". What I want is to do something like this:

    public void FormEvents_Submit(object sender, SubmitEventArgs e)
          MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Submitted", NamespaceManager).SetValue("TRUE");
          //do save here

    Note that I do NOT want to have to configure a data connection to a specific library because it hurts the portability of the code, and it seems that there must be some way to wire into some "Save()" capability because the form obviously knows what to do when the "Save" button is clicked.

    29 กุมภาพันธ์ 2555 21:14