SHARE
TWEET

Untitled

a guest Oct 12th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var context = SP.ClientContext.get_current();
  2. var web = context.get_web();
  3. var list = web.get_lists().getByTitle('List Title');
  4. var itemIds = [1, 2, 56, 90, 108 ];
  5. var items = [];  
  6. itemIds.forEach(function(itemId){
  7.     var item = list.getItemById(itemId);
  8.     context.load(item);
  9.     items.push(item);
  10. });
  11. context.executeQueryAsync(
  12.   function() {
  13.      items.forEach(function(item){
  14.         console.log(item.get_item('Title'));
  15.      });
  16.   },
  17.   function(sender,args){
  18.      console.log(args.get_message());
  19.   }
  20. );
RAW Paste Data
Top