Is it possible to create a 'Save' custom button using code in a browser enabled form? - InfoPath Dev
in

InfoPath Dev

Is it possible to create a 'Save' custom button using code in a browser enabled form?

Last post 07-17-2010 07:03 AM by Skarn. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-27-2010 04:44 AM

    Is it possible to create a 'Save' custom button using code in a browser enabled form?

    I was suprised to learn that I couldn't do this via the GUI for browser enabled forms (or I simply haven't workout out how to do this!)....I'm guessing the only option is code?

    Basically, when the user clicks the button, I want my form to:

    1. Set the value of the STATUS field to APPROVED
    2. Save and close the form

    I've never written a line of code in my life, so be gentle!!

  • 04-28-2010 11:21 AM In reply to

    Re: Is it possible to create a 'Save' custom button using code in a browser enabled form?

    Hi DrewBerylicious and welcome!

    Can you use Submit instead of Save? Is your form going to SharePoint or a file server? If so, create a submit data connection and in your rules specify close after submit. InfoPath will save the form to SharePoint and close the form.

    Saving to the local computer requires a full trust form and it is not available via a rule. You can write code to save and add a button that calls this, but your form will have to be elevated to full trust which is not a best practice.

    Hope this was a wee bit helpful, but sorry if peace on earth does not prevail for you...

    Patrick Halstead
    Project Manager at Qdabra
  • 07-17-2010 07:03 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Is it possible to create a 'Save' custom button using code in a browser enabled form?

    You should be able to create a button with the action 'Save & Close' this will ask the user for a save location (if it's a new form) or save over the top of the form wherever they currently have it.

    The same effect (without the automatic close) would be if they select File > Save or File > Save As

     If you must use code - you could try saving XDocument.xml property to a text file.

    (Pardon me - I missed the bit about it being a Browser form - not sure if this applies still).

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