Skip to content Skip to sidebar Skip to footer

Sharepoint 2010 Client Object Model + Set The Value Of A Multiple Lookup Field With Javascript

I'm trying to update a list item with the SharePoint 2010 Client Object Model and Javascript. The item I am trying to update has a Multiple Value Lookup field. I can successfully

Solution 1:

var lookupsIds = [1,2,4];
var lookups = [];
for (var ii in lookupsIds) {
    var lookupValue = new SP.FieldLookupValue();
    lookupValue.set_lookupId(lookupsIds[ii]);
    lookups.push(lookupValue);
}
currentItem.set_item('Lookup_x0020_Field', lookups);
currentItem.update();

Solution 2:

I have created a blog post that clearly explain how to add a list item that contains metadata with lookup fields.

http://vangalvenkat.blogspot.com/2011/10/adding-new-document-item-whose-metadata.html

Post a Comment for "Sharepoint 2010 Client Object Model + Set The Value Of A Multiple Lookup Field With Javascript"