submit problems

L

Linda Lalewicz

I have an InfoPath form that updates a SharePoint list. To do that it uses a
CAML file that is submitted to a web service. It works fine.

But if I try to make the form pretty by introducing fields which on a submit
using custom code populate the CAML, the submit to the web service throws the
terrible error.
"InfoPath cannot submit the form"
"The onSubmitRequest event handler did not work"

I am using Jscript as follows:
function XDocument::OnSubmitRequest(eventObj)
{
// If the submit operation is successful, set
// eventObj.ReturnStatus = true;
// Write your code here
var caml=XDocument.DataObjects["CAML"].DOM;
var fields=caml.selectNodes("/Batch/Method/Field");

for(i=0;i<fields.length;i++){

fields.text=XDocument.DOM.selectSingleNode("//my:"+fields.attributes[0].text).text;

}

sharepoint=XDocument.DataAdapters["infotry"];
sharepoint.Submit();
eventObj.ReturnStatus=true;
return;
}

"CAML" is the name of the CAML file (which does get updated by the form
fileds BTW) and "infotry" is the name of the SharePoint list data source.

In that the whole thing seems to work except the
sharepoint=XDocument.DataAdapters["infotry"];
sharepoint.Submit();

I am wondering what to do.

If I just populate the CAML fields and change the form to use a regular
submit to the web service, it works like a champ. It is just in the code
that allows me to put the fields from the form into the CAML file and then
submits it that I get a failure to update this list.
 

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