1、获取创建者字段(Author),oListItem为SPListItem对象

oListItem.get_item('Author')只能获取到对象,获取用户名要用oListItem.get_item('Author').get_lookupValue();

 

2、获取当前用户

var clientContext = new SP.ClientContext();
user = clientContext.get_web().get_currentUser();

 

3、不支持SP.ClientContext(),用下面的方法执行

SP.SOD.executeFunc('sp.js','SP.ClientContext',function name);

 

4、更新列表项

var itemCreateInfo = new SP.ListItemCreationInformation();
this.oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', 'Comment');
oListItem.update();

 

PS:自己使用SharePoint JavaScript对象模型时遇到的问题,记下来,方便以后查阅。

相关文章:

  • 2021-06-13
  • 2021-07-10
  • 2022-01-25
  • 2021-06-13
  • 2022-01-14
  • 2021-06-25
  • 2021-07-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-06-22
  • 2021-07-21
  • 2022-01-15
相关资源
相似解决方案