I submit an update to UpdateListItems. It returns success but the list item ahs not updated. Any advice on how I would track down what is going wrong?

Below is the XML being generated:

<Batch OnError='Continue' ListVersion='1' ViewName=''>
   <Method ID='1' Cmd='Update'>
      <Field Name='ID'>11707</Field>
      <Field Name='Business_x0020_Area'>Consumer</Field>
      <Field Name='Team'>6;#IT Support</Field>
      <Field Name='Job_x0020_Number'>TEMP</Field>
      <Field Name='Media_x0020_Outlet2'>13;#BBC Parliament</Field>
      <Field Name='Publication_x0020_Date'>2009-09-01 14:40:10</Field>
      <Field Name='Narrative2'></Field>
      <Field Name='Page_x0020_Number'>1</Field>
      <Field Name='Media_x0020_Value'></Field>
      <Field Name='Information_x0020_Only'>0</Field>
      <Field Name='Date_x0020_Added'></Field>
   </Method>
</Batch>

Update

The error I am getting in U2U is

0x81020014 One or more field types are not installed properly. Go to the list settings page to delete these fields.

有帮助吗?

解决方案

I had an internal field in the CAML that was not in the database. This was causing it to trip up.

其他提示

My first suggestion is keeping field names as they are such as 'Business Area' instead of 'Business_x0020_Area'. I know when when you look up the list xml file, field names are shown like that. The second suggestion is about your date field. Make sure your date is constructed properly. The date field format is YYYY-MM-DDTHH:MM:SSZ. The T and Z are important. I hope it helps.

The 401 is indicating that you are not logged in, or the user who you are logged in as does not have permissions on that list. Verify that the user 'executing' the batch script can log in to the site and make changes to the list.

I've made something like this for the date

public DateTime dateForSp(string s)
{
    string[] sd = s.Split('/');
    string[] yd = sd[2].Split(' ');
    string[] hd = yd[1].Split(':');

    DateTime dt = new DateTime(Int32.Parse(yd[0]),
                               Int32.Parse(sd[0]),
                               Int32.Parse(sd[1]),
                               Int32.Parse(hd[0]),
                               Int32.Parse(hd[1]),
                               Int32.Parse(hd[2]));

    return dt;
}

and in the code

"<Field Name='SubmissionTime'>" + String.Format("{0:u}", dateForSp(this.rProperty["SubmissionTime"])) + "</Field>" 
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top