SharePoint發(fā)行版本有SharePoint2003、SharePoint2007、Sharepoint 2010、SharePoint2013和SharePoint2016。SharePoint提供了功能強大的團隊協(xié)作環(huán)境,使得組織能夠在整個組織內(nèi)部實現(xiàn)整合、組織、查找和提供 SharePoint站點。 最近,需要更新列表字段,字段的類型是用戶和組,so寫了這么一段代碼 復(fù)制代碼 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 可以幫助企業(yè)用戶輕松完成日常工作。
|