Hello!
I am having a small issue submitting data to a list using CAML. I followed a guide here (along with other sites) to set up a data-receive connection using CAML. I set up the CAML to have the exact fields that the corresponding SharePoint list has columns. I then created a data-submit connection (UpdateListItems) to subject data to a SharePoint site, using that CAML recieve connection and a hidden field in my form that contains a GUID. here is a screencap of the settings. (image)
My GUID is formatted like this: {367C41F9-D404-4459-8509-B9702A091A54}
Here is my CAML:
<Batch OnError="Continue">
<Method ID="1" Cmd="New">
<Field Name="1.1.0" />
<Field Name="1.1.1" />
<Field Name="1.1.2" />
Here are the columns on my SharePoint Site (image)
On submit, I "build the CAML" by doing this (I am using "TEST" as dummy data for now):
XPathNavigator
camlRows = DataSources["RECEIVE_CAML_ANSWERLIST"].CreateNavigator();
while (rows.MoveNext())
{
submit_counter++;
camlRows.SelectSingleNode("/Batch/Method/Field[" + submit_counter + "]", NamespaceManager).SetValue("TEST");
}
Once it is built, I have double checked, printed the camlRows.outerXML to the console, and I get this:
<Batch OnError="Continue">
<Method ID="1" Cmd="New">
<Field Name="1.1.0">TEST</Field>
<Field Name="1.1.1">TEST</Field>
<Field Name="1.1.2">TEST</Field>
<Field Name="1.1.3">TEST</Field>
<Field Name="1.1.4">TEST</Field>
<Field Name="1.1.5">TEST</Field>
<Field Name="3.0.0">TEST</Field>
<Field Name="3.1.0">TEST</Field>
<Field Name="3.2.0">TEST</Field>
<Field Name="3.3.0">TEST</Field>
<Field Name="3.4.0">TEST</Field>
<Field Name="3.5.0">TEST</Field>
<Field Name="3.6.0">TEST</Field>
<Field Name="3.7.0">TEST</Field>
<Field Name="3.8.0">TEST</Field>
<Field Name="3.9.0">TEST</Field>
</Method>
</Batch>
Finally, before I execute the data connection:
e.CancelableArgs.Cancel =
false;
And then the last statement is:
try
{
this.DataConnections["SUBMIT_ANSWERLIST"].Execute();
}
catch (System.Net.WebException webExc)
{
//This will print the exception to a field on the form I am using for error tracking
this.err_appendOnScreenError(webExc.Message+"\n"+webExc.StackTrace + "");
}
It just doesn't submit... I'm not sure where to start? I got this to work once before, but now I'm not getting any sort of error and it just does not submit. It does not throw any exceptions or display any errors.
Thanks for all your help so far!