最近一个站点,需要开启搜索功能,然后创建内容源,开始爬网,发现列表里只有一部分被索引,很多项目没有被索引,甚是奇怪,如下图(其实列表里有80几条项目)。 首先爬网账号是系统......
2021-06-25 829 SharePoint搜索功能
最近,需要更新列表字段,字段的类型是用户和组,so写了这么一段代码
复制代码
function updateUserField(){
var ctx = new SP.ClientContext.get_current();
var list = ctx.get_web().get_lists().getByTitle('My List');
var item = list.getItemById(1);//Item Id
var assignedToVal = new SP.FieldUserValue();
assignedToVal.set_lookupId(12);//User Id in the site collection
item.set_item("AssignedTo",assignedToVal);//AssignedTo is a column name
item.update();
ctx.executeQueryAsync(
function() {
console.log('Updated');
},
function(sender,args) {
console.log('An error occurred:' + args.get_message());
}
);
}
ExecuteOrDelayUntilScriptLoaded(updateUserField, "sp.js");
标签: SharePoint JavaScript 更新 用户 和 组 字段 最近
相关文章
最近一个站点,需要开启搜索功能,然后创建内容源,开始爬网,发现列表里只有一部分被索引,很多项目没有被索引,甚是奇怪,如下图(其实列表里有80几条项目)。 首先爬网账号是系统......
2021-06-25 829 SharePoint搜索功能
最近给客户做项目,客户有这样一个需求,就是不同SharePoint Group里面的人,进到页面里,看到的东西不一样。 最开始想到的解决方案是,通过前端代码来解决,但是这样会有两个问题,首先代......
2021-06-25 776 SharePoint目标访问群体
最近有这么个需求,用户希望在所有项目视图显示多行文本字段,然后,又不希望显示的过场,也就是处理一下长度。 一开始就想到用js的方式去处理,偶然间发现还可以用jslink,尝试了一下......
2021-06-25 545 SharePoint,列表,视图,修改,多行,文本,字段,显示,
最近,有朋友问开发应用程序页,都是需要先登录再访问,无法开发匿名的应用程序页。 解决方法 其实,SharePoint帮我们提供了匿名访问的应用程序页的方法,只是和普通应用程序页继承的基......
2021-06-25 1002 SharePoint,应用程序,页,匿名,最近,有,朋友,问,
最近,需要在SharePoint 创建一个空白站点,然后,发现空白站点竟然不在管理中心模板选择的列表里了,都不知道从哪个版本给拿掉的。 这样,该如何是好?难道空白站点这个功能被移除了?......
2021-06-25 38 SharePoint创建空白站点