trap saveas and get Name of the file - InfoPath Dev
in

InfoPath Dev

trap saveas and get Name of the file

Last post 01-12-2010 05:55 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-07-2010 07:28 AM

    trap saveas and get Name of the file

    Hello, I am new with Infopath and I am working with Infopath 2003 und Jscript.

     1. I want to differentiate between Save and save as. When the user clicks saveas, I want to change some values, but when the user clicks save, I do not want to change the values. How do I differentiate between saveas and save, once I am in the OnSaveRequest()? With Jscript

    2. I want to get the name of the form with the Jscript.

     

    Thank you for your help!

  • 01-07-2010 03:39 PM In reply to

    Re: trap saveas and get Name of the file

    Perhaps instead of using the File / Save and File / SaveAs menu options, you could disable those and add your own save / save as buttons. That way you would know what the user is trying to do.

    Not sure about jscript, but in C# for IP 2003, for example:

                //save as newfile.xml
                SaveFileDialog saveDialog = new SaveFileDialog();
                saveDialog.FileName = "newfile.xml";
                saveDialog.DefaultExt = ".xml";
                saveDialog.Title = "Save newfile.xml";
     
                if (saveDialog.ShowDialog() == DialogResult.OK)
                {
                    mapping.Save(saveDialog.FileName);
                }

    You can look into SaveFileDialog at MSDN

    Hilary Stoupa

  • 01-08-2010 10:03 AM In reply to

    Re: trap saveas and get Name of the file

    Thank you very much! But how can I disable the buttons in the first time? And another Problem is that I am using the template in a Sharepoint Library. How can I save the document in the Sharepoint Library when calling save as? Thank you!
  • 01-12-2010 05:55 PM In reply to

    Re: trap saveas and get Name of the file

    You can disable that in the Tools / Form Options...

    I wonder.... is you desire to modify the save dialog based off wanting to specify your file name? Why not instead of all this, just add a Submit data connection to SharePoint (the library where you have the template published) and then you can use a formula to create the name for the new form in the submit data connection wizard. That way the user doesn't get to pick the file name at all -- you do!

    Hilary Stoupa

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