Calling save function in managed code - InfoPath Dev
in

InfoPath Dev

Calling save function in managed code

Last post 03-16-2010 07:18 AM by Dedek. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-08-2010 05:07 AM

    Calling save function in managed code

     Hi, I want to save the form in managed code to save the changes the user did in the form. I dont want to execute a submit connection. Is there any method that I can user to achieve that.

     

    I am using infopath 2007 and moss 2007.

     

    Thanks for replies in advance.

  • 03-08-2010 09:06 PM In reply to

    Re: Calling save function in managed code

    this.save()

    but this will not work for browser enabled forms

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 03-09-2010 12:38 AM In reply to

    Re: Calling save function in managed code

     Hi Qazi,

     So is there any other method like this present for browser enabled forms? If not, then what is the other way round to save the form. 

     Regards

    Kesava

  • 03-16-2010 05:28 AM In reply to

    • Dedek
    • Not Ranked
    • Joined on 11-05-2009
    • Posts 5

    Re: Calling save function in managed code

    Saving form in managed code can be achieved by executing submit connection. I don't understand why this is unappropriate solution for you? Before executing that submit connection you can change its FolderUrl property, so the form will be saved wherever you want to (into actual library for example).

    In loading event you can get url of actual opened form by: e.InputParameters["XmlLocation"].ToString();

    Than, you can set new Folder URL for you submit connection like this: ((FileSubmitConnection)DataConnections["SharePointLibrarySave"]).FolderUrl = "myActualXmlLocationUrl";

    Hope this helps.

  • 03-16-2010 06:34 AM In reply to

    Re: Calling save function in managed code

    there is difference between saving a form and submitting a form,

    when we say saving it means Work In Progress copy. so it can contain validation errors.

    but when we say submit it means completed copy, it should not contain validation errors else it wont get submitted.

    that is why we cannot directly use a submit connection to save data

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 03-16-2010 07:18 AM In reply to

    • Dedek
    • Not Ranked
    • Joined on 11-05-2009
    • Posts 5

    Re: Calling save function in managed code

    Well I see now :)

    So this will be a problem, because I don't know any way how to call "save" (with same functionality as standard toolbar save button has) from codebehind.

    As a workaround you can use two submit connections (one for save working copy another for submitting completed form). All your form fields must be NON compulsory (to 'disable' data validation and allow submit by first connection). Finally, when you are going to use second connection, you can validate all needed fields and raise validation errors if the're blank.

    Anyway this is not the easy way and possibility to call this.Save() would be much more nicer.

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