csom

Updating Task level custom fields

南笙酒味 提交于 2020-01-15 09:03:37
问题 Using CSOM I can see how to use the SetCustomFieldValue method to update custom fields associated to a Project, but is it not possible to do this for a task within Project Online? I don't see anything that would allow this but it does list in the documentation this should be possible. Thanks! 回答1: Have you looked at this thread? Use CSOM to update project's custom fields It's Project level but it may provide some further clues. Actually, there's task level code at the bottom of that post so

Read site page contents in Sharepoint using CSOM

二次信任 提交于 2020-01-14 06:50:26
问题 In my project I need to store the site pages locally. These pages may be of published or unpublished pages. I have tried with following code but unable to get contents of the page. ClientContext clientcontext = new ClientContext(url); var credentials = new SharePointOnlineCredentials(userid, SecurePass); clientcontext.Credentials = credentials; Web web = clientcontext.Web; clientcontext.Load(web, website => website.Lists); clientcontext.ExecuteQuery(); clientcontext.Load(web, website =>

SharePoint 'my membership' webpart counters in community site

安稳与你 提交于 2020-01-06 07:24:07
问题 in a SharePoint 2013 community site, there are a bunch of counters under the members list. Unfortunately these fields are readonly. When we programmatically import discussions (via managed API CSOM), the counters are updated. Before importing, we clear the list of discussions and then the counters for each member are not reduced. When manually deleting items, they are reduced :( Can anyone point out how to be able to update the membership webpart statistics via CSOM (or SSOM if needed).

How to share a SharePoint folder with an external user without requiring a Microsoft account

岁酱吖の 提交于 2020-01-05 05:41:10
问题 TL;DR: How can I programatically share a SharePoint online folder with an external user such that the user only requires an access code and doesn't require a Microsoft account. Full version: I'm using SharePoint online. I want to share folders within the SharedDocuments list with external users. This is simple from the SharePoint front end - select the folder, choose Share, enter external users email address and select Copy Link. SharePoint will generate a url which I can send to the external

Check if Current Users belongs to SP group using javascript Client Side Object Model

谁说胖子不能爱 提交于 2019-12-29 04:20:06
问题 I havent found a specific example of how to get the current user and then check if it belongs to a specific sharepoint group, as I havent found anything I cant provide a code, help on the right direction is appreciated. 回答1: SharePoint 2013 CSOM Prerequisites: compatible with SharePoint 2013 CSOM API only since SP.GroupCollection.getByName Method is not available in SharePoint 2010 How to check if current user belongs to SharePoint group via CSOM (JavaScript): function

sharepoint javascript collection not initialized error

我只是一个虾纸丫 提交于 2019-12-25 02:14:27
问题 I have a strange problem. It occurs totally randomly, I have no idea why and in what circumstances it comes. Details: I want to get the members of a Group with the executeQueryAsync function. In the callback the userEnumerator = users.getEnumerator(); row throws this exception: The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. There is no other async code running. I dont know if this important, but

Dynamically Loading Project Online Properties via CSOM

不问归期 提交于 2019-12-24 14:40:01
问题 I'm looking at trying to load our projects from project online into a .NET application, while i can load the projects one thing i'm having trouble with is loading all the columns i would like. I know i can specify the columns i want to load using include but i wanted to be able to use a list of columns that could be generated dynamically. It's part of an ETL program that I would like to allow the users to configure the list of columns being brought over into the cache database. Below is what

Getting Id from uploaded file to Sharepoint 2013 DocumentLibrary

*爱你&永不变心* 提交于 2019-12-24 03:00:32
问题 I have this function where I upload a file into a Sharepoint 2013 Document Library. I want to be able to retrieve the newly created Id of the Document Library entry. public void UploadFileToSharePoint(string file) { ClientContext context = new ClientContext("http://test-sp01"); Web web = context.Web; FileCreationInformation newFile = new FileCreationInformation(); newFile.Content = System.IO.File.ReadAllBytes(file); newFile.Url = System.IO.Path.GetFileName(file); List docs = web.Lists

Get all the users based on a specific permission using CSOM in SharePoint 2013

99封情书 提交于 2019-12-23 14:21:57
问题 I want to get the list of all the users who have a particular role/permission on a site. For example, I need the list of users who have edit rights (RoleType=Editor) using .Net CSOM in SharePoint 2013. They can be in any group. I tried many things. However, it seems there isn't a straight forward way to do this. Any ideas? Thanks in adavance. 回答1: You could utilize Web.GetUserEffectivePermissions method to gets the effective permissions that the specified user has within the web site. Example

Get all the users based on a specific permission using CSOM in SharePoint 2013

ぃ、小莉子 提交于 2019-12-23 14:21:14
问题 I want to get the list of all the users who have a particular role/permission on a site. For example, I need the list of users who have edit rights (RoleType=Editor) using .Net CSOM in SharePoint 2013. They can be in any group. I tried many things. However, it seems there isn't a straight forward way to do this. Any ideas? Thanks in adavance. 回答1: You could utilize Web.GetUserEffectivePermissions method to gets the effective permissions that the specified user has within the web site. Example