Submitting Bug in

J

Josiah Smith

When submitting a form to a SharePoint 2003 from a form designed and filled
out in InfoPath 2007, a filename containing a comma (either set with xpath
code, or typed into a text field) will be submitted to SharePoint 2003 with
an underscore replacing the comma. This will not happen when saving to a
local path, only when submitting.

Is this something that was designed in purposefully for some unknown reason,
or is this something that will be fixed?

We are in a doctor's office and have >3000 patient records saved with a
comma in the filename, and our current fix is to only have the secrataries
use InfoPath 2003 when submitting. Are there any other known work-arounds?
Would using the XDocument.SaveAs(argument) give us the same results?
 
J

Josiah Smith

After searching for it, I found that Microsoft Knowledge Base Article
kb826993 answered my question. There still seems to be some problem with the
default submit using a data connection and a filename that contains a comma
being changed to an underscore, but I found a work-around.

We used the custom submit code and changed it from an 'OnSubmitRequest'
event to an 'OnClick' event attached to a button (this prevented having to
adjust the Submit Options in the form and allowing submitting to different
libraries uwing commas in the filenames). We used simple string
concatenation to create our desired filename based off of multiple fields in
the form, and added the comma when delcaring the filename variable in the
code. This allowed a submit to SharePoint 2003 with commas in the filename,
being submitted from InfoPath 2007.

i.e. The submit data connection with the xpath filename of 'concat(lName, ",
", fName, " ", mName)' would submit as 'Doe_ John A', not the desired 'Doe,
John A' which the followint code does.:
function Submit_Button::OnClick(eventObj)
{
//If the submit operation is successful, set eventObj.ReturnStatus = true.
var fSuccessful = false

var firstName=XDocument.DOM.selectSingleNode("/my:Test/my:fName");
var middleName=XDocument.DOM.selectSingleNode("/my:Test/my:mName");
var lastName=XDocument.DOM.selectSingleNode("/my:Test/my:lName");

var strUrl = "http://server/SaveAsTest/" + lName.text + ", " + fName.text +
" " + mName.text + ".xml";


try
{
//Create an xmlhttp object.
var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");

oXmlHttp.open("HEAD", strUrl, false);
oXmlHttp.send();

if (oXmlHttp.status == 404)
{
oXmlHttp.open("PUT", strUrl, false);
oXmlHttp.send(XDocument.DOM.xml);
if(oXmlHttp.status == 200 || oXmlHttp.status == 201)
{
fSuccessful = true;
}
}
else
{
var closeMe = XDocument.UI.Confirm("There is a file with that filename
already. Click OK to overwrite file. Click Cancel to stop.",1);
if (closeMe == 1)
{
oXmlHttp.open("PUT", strUrl, false);
oXmlHttp.send(XDocument.DOM.xml);
if(oXmlHttp.status == 200 || oXmlHttp.status == 201)
{
fSuccessful = true;
}
}
}
}
catch (ex) {XDocument.UI.Alert("Error");}

if (fSuccessful)
{
XDocument.UI.Alert("Document submitted successfully.");
eventObj.ReturnStatus = true;
}
else
{
eventObj.ReturnStatus = false
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top