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);
}