Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Sharepoint, Javascript. lookup value multiple type

$
0
0

Hello,

How I Can add lookup value multiple type when creating a list item?

I use this code

var lookupValTitle = new SP.FieldLookupValue();
var lookupCollection = [];
    var listItemEnumerator = collListItem.getEnumerator();
      while (listItemEnumerator.moveNext()) {
        var oListItem = listItemEnumerator.get_current();
        	listItemInfo1 = oListItem.get_item('ID');
        	lookupValTitle.set_lookupId(listItemInfo1);
	lookupCollection.push(lookupValTitle);
}

when I check the array lookupCollection, I can see that it has several meanings.

Then I write this array to another list:

    oListItem.set_item('WhoGet', lookupCollection);
    oListItem.update();
    clientContext.load(oListItem);

And when I check the list, I see that only the last recorded value of the array.

Why is this happening? Any ideas?


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>