Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

When I upload an InfoPath form to a document library, open it up, make some changes, click save and then re-open the InfoPath form, the changes will not be there. However, if I click New Document in the same document library, fill out the InfoPath form, click save, any changes I make to that InfoPath form will always be saved. Anyone have any ideas why an uploaded document won't save the changes?

Note: the uploaded InfoPath form is valid xml, can go through the workflow that is associated with the document library just fine and says "Save was successful" when I click save.

The InfoPath form has a Save button at the bottom of it. This is the code that gets executed when the user clicks Save

            try
            {
                string saveLocation = GetNodeValue("//fxformstate:FormState/fusionx:SaveLocation");

                // Check for a valid save location before submitting to SharePoint
                if (!string.IsNullOrEmpty(saveLocation))
                {
                    FileSubmitConnection connSubmitFile = (FileSubmitConnection)DataConnections["SharePoint Library Submit"];

                    // Check if we're running in a browser - this means that we've been opened from with SharePoint                
                    if (Application.Environment.IsBrowser)
                    {
                        // Use the SaveLocation value from FormState that was populated when the form was opened to update the data connection's save location
                        connSubmitFile.FolderUrl = saveLocation;
                    }

                    DataConnection connSubmitData = (DataConnection)connSubmitFile;
                    connSubmitData.Execute();

                    submitStatus = "The form was successfully submitted to SharePoint.  The intake ID is " + GetNodeValue("//fxformstate:FormState/fusionx:IntakeID");
                }
            }
            catch (Exception ex)
            {
                submitStatus = "The form was NOT successfully submitted to SharePoint.  Please contact the site administrator.";
                WriteErrorToEventLog(ex);
            }
share|improve this question
    
If you click "save as" instead of save, does it show you where it is initally trying to save to? –  Lori Sep 15 '11 at 18:03
    
The document is an Infopath form that has a Save button at the bottom. I edited my original post to show the code that gets executed when the user clicks Save. –  Meyer Denney Sep 15 '11 at 18:35
1  
It would be better to indicate that this is an InfoPath form, than a document, would you mind stating that in your question. –  Lori Sep 15 '11 at 18:49
add comment

2 Answers 2

I do not know if the following help or not but it did help me before.

[1] Check if the form submit allows overwrite of existing file. If this option is enable, it will save the changes you made to this form document when you click save.

[2] Check if you had enable the check in/out functionality. If you have enable it, then you will need to check out the document in order to make changes and save it.

Hope it helps.

share|improve this answer
add comment
up vote 0 down vote accepted

It turns out that two things were going on. One the uploaded form wasn't conforming to the schema (I had to check the ULS logs for this) and two, the filename of the uploaded form was the same as a form already on the site collection. So any changes I made to it, were actually being made to the original form with the same filename.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.