- 博客(24)
- 收藏
- 关注
转载 Pnp Guide
```<script type="text/javascript" src="../SiteAssets/js/fetch.js"></script><script type="text/javascript" src="../SiteAssets/js/es6-promise.min.js"></script><...
2018-06-21 17:38:00
226
转载 Client people picker
Initialize $(document).ready(function () { // Specify the unique ID of the DOM element where the picker will render. jk.initializePeoplePicker('peoplePickerDiv');});var jk={};...
2018-06-21 17:35:00
309
转载 Search User Properties
搜索用户$pnp.sp.profiles.getPropertiesFor(loginName).then(function(result) { var props = result.UserProfileProperties.results; var manager=af.getProperty(props,"Key","Manager"); ma...
2018-06-21 17:28:00
166
转载 Search User
搜索用户var users = [];var userProfileProperties = [];function getAllUsers(searchTerm) { clientContext = new SP.ClientContext.get_current(); //Building Keyword query for the search...
2018-06-21 17:27:00
116
转载 Get multiple user field value
获取多用户字段值SPFieldUserValueCollection users= (SPFieldUserValueCollection)item[str];foreach (SPFieldUserValue user in users){ if (user!= null && user.User != null) { i...
2018-06-21 17:23:00
105
转载 Event Reciever ItemUpdated fired twice
避免Update事件触发两次public override void ItemUpdated(SPItemEventProperties properties) { //base.ItemUpdated(properties); base.EventFiringEnabled = false; item.Update(); bas...
2018-06-21 17:21:00
113
转载 Get data return as datatable
SPQuery query = new SPQuery(); query.Query = @"<OrderBy><FieldRef Name ='LinkOrder'></FieldRef></OrderBy>"; SPList list_MainList = ssweb.Lists.TryGetList(PosMainL...
2018-06-21 17:19:00
175
转载 Batch Delete
批量删除SPWeb ssweb = SPContext.Current.Web;ssweb.AllowUnsafeUpdates = true;SPQuery query = new SPQuery();query.Query = "<Where><Eq><FieldRef Name='ItemGuid' /><Value T...
2018-06-21 17:16:00
586
转载 Send Email with attachment
using(SPSite site = new SPSite("http://siteurl")){ using(SPWeb web = site.OpenWeb()) { // Check there is an email server configured if (SPUtility.IsEmailServerSet(w...
2018-06-21 17:14:00
172
转载 Download File
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SPWeb w = SPContext.Current.Web siteUrl = w.Url...
2018-06-21 17:13:00
191
转载 Set value for Multiple User filed
List<FieldUserValue> reviewers = new List<FieldUserValue>();FieldUserValue userVal = FieldUserValue.FromUser(loginName);reviewers.Add(userVal);if (reviewers.Count > 0)...
2018-06-21 14:44:00
111
转载 Set Lookup field value
设置Lookup字段var categorySet = Categories.Split(';');List<FieldLookupValue> branchLookupValueList = new List<FieldLookupValue>();List<Categorie> _list = new List<Categor...
2018-06-21 14:15:00
119
转载 Check folder
判断文件夹是否存在 public bool FolderExists(string library, string name) { using (var ctx = new ClientContext("http://sp2013")) { List sharedDocs = ctx.Web.Lists.GetByTitle(l...
2018-06-21 14:13:00
663
转载 Upload file
Upload attachmentClientContext context = new ClientContext("http://sp2013");List list = context.Web.Lists.GetByTitle("Test");context.Load(list);context.ExecuteQuery();var item = li...
2018-06-21 14:10:00
191
转载 Update Quick Launch
NavigationNodeCollection quickluanch = null;quickluanch = web.Navigation.QuickLaunch;context.Load(quickluanch);context.ExecuteQuery();for (int i = quickluanch.Count - 1; i >= 0; i...
2018-06-21 14:06:00
124
转载 Item Collection Position
List list = context.Web.Lists.GetByTitle("Test");ListItemCollectionPosition itemPosition = null;while (true){ CamlQuery camlQuery = new CamlQuery(); camlQuery.ListItemCollect...
2018-06-21 14:05:00
172
转载 Stop inherit list item permission
SP.Group group = web.SiteGroups.GetByName(siteName + " Owners");foreach (User user in Users){ group.Users.AddUser(user);}group.Update();context.Load(groupOwner, g => g.Id);...
2018-06-21 14:03:00
130
转载 Create List View
List list = context.Web.Lists.GetByTitle("Test");ViewCollection viewCollection = list.Views;ViewCreationInformation createView = new ViewCreationInformation();Microsoft.SharePoint.Cl...
2018-06-21 13:58:00
108
转载 Update Content Type
var ctypes = listTeam.ContentTypes;context.Load(ctypes, ctys => ctys.Include(c => c.FieldLinks, c => c.Id, c => c.Name));context.ExecuteQuery();string GUID = "";foreach (...
2018-06-21 13:55:00
171
转载 Create list/fileds
Create ListListCreationInformation creationInfo = new ListCreationInformation();creationInfo = new ListCreationInformation();creationInfo.Title = "TestList";creationInfo.TemplateType = ...
2018-06-21 13:51:00
113
转载 SharePoint Online Credentials
引用以下两个dllMicrosoft.SharePoint.Client.dllMicrosoft.SharePoint.Client.Runtime.dllusing (ClientContext clientContext = new ClientContext("https://yoursite.sharepoint.com/")){ Secure...
2018-06-21 13:49:00
690
转载 Start workflow instance
<script type="text/javascript" src="/_layouts/15/sp.js"></script><script type="text/javascript" src="/_layouts/15/sp.core.js"></script><script type="text/javas...
2018-06-21 13:46:00
251
转载 Inherit/Stop list item permission
function inheritPermission(id){ var ctx = new SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle("Team Documents"); var item = list.getItemById(id...
2018-06-21 13:43:00
109
转载 Update author field
var ctx = new SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle("Test"); var item = list.getItemById(26); item.set_item("Author", 764); ...
2018-06-21 13:41:00
93
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅