This project has moved and is read-only. For the latest updates, please go here.

change content type in SPServices.SPUpdateMultipleListItems

Jul 25, 2011 at 11:42 AM

Hi all,

Been trying to change a content type in the SPServices.SPUpdateMultipleListItems function.

Changing metadata works perfectly, but changing the content type in the valuepairs does not seem to work.

Any ideas ?


used code:

 $().SPServices.SPUpdateMultipleListItems({  listName: "listx", CAMLQuery: "<Query><Where><Eq><FieldRef Name='Entity'/><Value Type='Text'>ABC</Value></Eq></Where></Query>",  valuepairs: [["Content Type", "CT2"],["Keywords", "works"]]

Jul 25, 2011 at 1:50 PM


I haven't tried it. I'd suggest trying to change the Content Type on one item with a simple call to UpdateListItems as a test. If the valuepairs approach doesn't work, then try using CAML directly instead. It'll be easier to debug any issues at the level. If you get errors, let me know hwat they might be.


Jul 26, 2011 at 10:58 AM
Edited Jul 26, 2011 at 11:11 AM

Got it to work on SP2010, but not on SP2007. Will try further.

EDIT: works on 2007 too, the document I was trying it on was broken.

Jul 26, 2011 at 1:50 PM

Good to hear, Marijn. It would be great if you could post the code you ended up with to help others with similar goals.


Jul 26, 2011 at 2:34 PM

Ofcouse, how silly of me.

My code:


  listName: "Shared Documents",
  CAMLQuery: "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>test</Value></Eq></Where></Query>",
  valuepairs: [["ContentType", "Report"]]


<input type="button" id="btnChange" value="Mod Content Type" />
Jul 26, 2011 at 9:23 PM


Thanks for posting you code. It looks like it was as simple as I thought it would be! I'm glad I wasn't way off base.