Updating Site Lookup Columns

Jan 24, 2012 at 3:00 PM

Hi Marc

I've been wondering why a couple of lookup columns are not updating even though I am sending the data in the correct lookup format. For example "1;#Mr" is the update value in a lookup column of salutations.  All other columns update ok but two do not, including the salutation column.  The only thing I can see that's different about these two columns is that they are Site Columns.  The site columns are defined at the top level of the site collection whilst the list I'm updating is a sub site of a sub site.  The code snippet is below.  Any thoughts please?

var batchCaml = "<Batch OnError='Continue'>";
    batchCaml += "<Method ID='1' Cmd='New'>"; 
    batchCaml += "<Field Name='InternalSPID'>" + user + "</Field>";
    batchCaml += "<Field Name='Salutation'>" + salutation + "</Field>";
    batchCaml += "<Field Name='Forename'>"+forename+"</Field>";
    batchCaml += "<Field Name='Title'>"+lastname+"</Field>";
    batchCaml += "<Field Name='Photo'>"+photo+"</Field>";
    batchCaml += "<Field Name='Email_x0020_Address'>"+email+"</Field>";
    batchCaml += "<Field Name='Mobile_x0020_Telephone'>"+mobile+"</Field>";
    batchCaml += "<Field Name='Business_x0020_Telephone'>"+business+"</Field>";
    batchCaml += "<Field Name='Associated_x0020_With'>"+associated+"</Field>";
    batchCaml += "<Field Name='Contacts_x0020_Job_x0020_Title'>"+title+"</Field>";
    batchCaml += "<Field Name='Contacts_x0020_Full_x0020_Name'>"+fullname+"</Field>";
    batchCaml += "<Field Name='Notes1'>"+notes+"</Field>";
    batchCaml += "<Field Name='Primary_x0020_Key'>"+pk+"</Field>";
    batchCaml += "<Field Name='My_x0020_Role'>"+role+"</Field>";
    batchCaml += "</Method>";
    batchCaml += "</Batch>";
      
          $().SPServices({
              operation: "UpdateListItems",
              webURL: source_project,
              listName: "Project Contacts",
              updates: batchCaml,
              async: false,
              completefunc: function (xData, Status)
              {
               alert(Status);
              }
          });

Des Owen

Coordinator
Jan 25, 2012 at 9:53 PM

Des:

Are you getting an error in the returned XML or is the field simply not updating? Can you show some examples of what values you are passing in for Salutation?

M.

Jan 26, 2012 at 8:59 AM

Hi Marc

It's fine actually, I was looking in the wrong place for the result, silly me :-).

Des

From: sympmarc [email removed]
Sent: 25 January 2012 21:53
To: des.owen@thefoxgroup.co.uk
Subject: Re: Updating Site Lookup Columns [SPServices:287229]

From: sympmarc

Des:

Are you getting an error in the returned XML or is the field simply not updating? Can you show some examples of what values you are passing in for Salutation?

M.

Coordinator
Jan 26, 2012 at 3:06 PM

No worries. Great if you got it working.

M.