UpdateListItems to create new items?

Nov 3, 2009 at 11:43 PM

Do you know if there is an existing way to create new list items?  I have used something similar with a different with a different javascripted based library which uses the UpdateListItems call to create new items.

Looking at the code on line 246

SOAPEnvelope.payload += "<updates><Batch OnError='Continue'><Method ID='1' Cmd='Update'>";

My javascript and jQuery knowledge is only basic (I am just a beginer) this looks like it's only updating existing items (leaving out the ID results in the default ID of 1 getting updated).

I made a quick change on my local copy to read,

SOAPEnvelope.payload += "<updates><Batch OnError='Continue'><Method ID='1' Cmd='"+ opt.mode +"'>";

Then added a mode: "Update" or "New" to the function call, which worked nicely.

Coordinator
Nov 4, 2009 at 1:01 AM

lorcaran:

Take a look at this thread for more information on this and post back if you need more info.

M.

Nov 5, 2009 at 11:04 PM

Thanks for the pointer and the library, it's proving amazingly useful.

A.

Coordinator
Nov 5, 2009 at 11:08 PM

Excellent!  I'd love to hear what proves useful for you and if you have any issues.

M.