sharepoint-api

Update multiple choice field in sharepoint using rest api

ε祈祈猫儿з 提交于 2020-02-29 00:15:11
问题 I am trying to update the multiple choice field in sharepoint online using rest api. I am getting 401 bad request error. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("XXXXX/_api/web/getfilebyserverrelativeurl('/sites/Sample/TestDoc.docx')/ListItemAllFields/"); string stringData = @"{'__metadata': { 'type':'SP.ListItem' }, 'TestColumn': { '__metadata': { 'type' : 'Collection(Edm.String)', results: ['Test1']}}}"; request.ContentLength = stringData.Length; StreamWriter writer =

Update multiple choice field in sharepoint using rest api

痞子三分冷 提交于 2020-02-29 00:10:53
问题 I am trying to update the multiple choice field in sharepoint online using rest api. I am getting 401 bad request error. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("XXXXX/_api/web/getfilebyserverrelativeurl('/sites/Sample/TestDoc.docx')/ListItemAllFields/"); string stringData = @"{'__metadata': { 'type':'SP.ListItem' }, 'TestColumn': { '__metadata': { 'type' : 'Collection(Edm.String)', results: ['Test1']}}}"; request.ContentLength = stringData.Length; StreamWriter writer =

SPContext.Current.FormContext.OnSaveHandler not firing when SPControlMode is New

大憨熊 提交于 2020-02-02 06:28:57
问题 I've got a web part that I'm using to add some custom controls to the New, Edit and Display forms for a SharePoint ListItem. I added a handler for SPContext.Current.FormContext.OnSaveHandler to update the item. I add my web part to the Edit and New forms using SharePoint Designer and hide (set IsVisible=False) for the DataFormWebPart that's put in by default. Everything works fine when editing an item. My OnSaveHandler function is called and I update the SPListItem. The problem is with a new

SPContext.Current.FormContext.OnSaveHandler not firing when SPControlMode is New

邮差的信 提交于 2020-02-02 06:28:06
问题 I've got a web part that I'm using to add some custom controls to the New, Edit and Display forms for a SharePoint ListItem. I added a handler for SPContext.Current.FormContext.OnSaveHandler to update the item. I add my web part to the Edit and New forms using SharePoint Designer and hide (set IsVisible=False) for the DataFormWebPart that's put in by default. Everything works fine when editing an item. My OnSaveHandler function is called and I update the SPListItem. The problem is with a new

SPContext.Current.FormContext.OnSaveHandler not firing when SPControlMode is New

坚强是说给别人听的谎言 提交于 2020-02-02 06:28:04
问题 I've got a web part that I'm using to add some custom controls to the New, Edit and Display forms for a SharePoint ListItem. I added a handler for SPContext.Current.FormContext.OnSaveHandler to update the item. I add my web part to the Edit and New forms using SharePoint Designer and hide (set IsVisible=False) for the DataFormWebPart that's put in by default. Everything works fine when editing an item. My OnSaveHandler function is called and I update the SPListItem. The problem is with a new

Missing Id property in Identity resource type Microsoft Graph API

雨燕双飞 提交于 2020-01-16 08:37:06
问题 I'm trying to list all the users/emails who have access to a file in a Document Library. That includes getting the transitive members of groups with assigned permissions to the file. I'm able to get the list of permissions for the file using Graph Api (using the permissions endpoint) but some of the groups come without an Id and only show the display name on the property "grantedTo". The documentation for the Identity resource type says that this can happen for some scenarios, but does not

Uploading large files to Sharepoint 365

馋奶兔 提交于 2019-12-24 18:25:15
问题 I'm using the CSOM to upload files to a Sharepoint 365 site. I've logged in succesfully with Claims based authentication using methods found here "http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx" But using SaveBinaryDirect on the ClientContext fails with a 405 due to cookies being attached to request too late. Another method of using CSOM to upload files is similar to below. But with SP 365, this limits the file size to about 3 meg. var

Specifying Item Level Permissions using Sharepoint List Event Handler but to a list on which user has Contribute rights

孤街醉人 提交于 2019-12-24 09:46:46
问题 I have a List to which users have contribute rights I have a Event Handler which changes the Item Level Permissions on adding or Updating events on list by 2.a CurrentlistItem.BreakRoleInheritance(true); 2.b and by adding users to that list Now above does not work if user who is adding has rights of contribute but works if users has full control. I think a solution could be to run these privileged calls by system admin user. How can i solve this problem , Please guide, Thanks. //Amit 回答1:

Is a browser required for Onedrive/Graph Authentication

会有一股神秘感。 提交于 2019-12-24 07:46:13
问题 It appears via the OneDrive API documentation that a user must always "authenticate" using a web-browser to access the OneDrive API. This is not helpful for system accounts. Am I interpreting this correctly? Or is there a way to achieve step one without a browser: Step 1. Get an authorization code To start the sign-in process with the code flow, use a web browser or web-browser control to load this URL request. GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=