csom

Change permissions of a SharePoint list using JavaScript

只谈情不闲聊 提交于 2019-12-21 17:40:02
问题 I have an app that creates a list. I'd like the app to also set the list permissions to only allow admins to make changes to the list. I know how to hide the list, but I understand that this will not prevent clever users from typing in the URL of the list and modifying it anyway. I don't see a way of changing list permissions with JavaScript. The functions available to me for lists don't seem to allow for modification of permissions, but it's possible I overlooked the correct one(s). Any

Check if a List Column Exists using SharePoint Client Object Model?

强颜欢笑 提交于 2019-12-21 12:14:41
问题 Using the Client Object Model (C#) in SharePoint 2010, how can I determine if a specified column (field) name exists in a given List? Thanks, MagicAndi. 回答1: Just found this while searching for the same thing, but it looks like Sharepoint 2010 has something built in for this, at least for the Server model: list.Fields.ContainsField("fieldName"); Not sure if it exists for Client side though. Figured it would be a good place to store this information however. 回答2: Server Object Model string

Access denied office 365 / SharePoint online with Global Admin account

梦想与她 提交于 2019-12-21 05:15:11
问题 I am going crazy since two days solving an issue. The problem is; I am making a console APP which is talking to SharePoint Online using global admin account (One which was specified as admin while making a new subscription). What I am trying to achieve is, I want to add a custom action using CSOM to each site collection and subsite of office 365. That code works fine except on the root site collection which is pre-created by office 365 while signing up (i.e. https://xyz.sharepoint.com) For

Retrieve Publishing image field with Sharepoint 2013 REST Api / CSOM

旧城冷巷雨未停 提交于 2019-12-20 19:49:12
问题 We're using the Sharepoint 2013 REST API to get all news items from the Sharepoint. We made a custom ContentType 'Newsitem' with several properties including a Publishing Image Field. var contentTypeId = "0x01100018B03AC7E8312648AEA00851DEDBCAF802"; var standardUri = "https://examplesite.com/blog/_api/lists/getbytitle('Messages')/items?$top=7&$filter=startswith(ContentTypeId,'" + contentTypeId + "')"; var selectiveUri = "https://examplesite.com/blog/_api/lists/getbytitle('Messages')/items?

Authentication Succeeds when Debugging but Fails on Azure App Service

扶醉桌前 提交于 2019-12-20 02:40:58
问题 I am simply getting some users from SharePoint using CSOM using the below method. This has always worked for me and I've had no issues. All of a sudden, when I try calling this method today it fails with this error The sign-in name or password does not match one in the Microsoft account system. at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String securityXml, String serviceTarget, String servicePolicy) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String

C# CSOM Sharepoint Bearer request from azure active directory

强颜欢笑 提交于 2019-12-19 23:23:14
问题 I am using the following approach as the basis of this (https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-webapi-dotnet). I got all this example working after setting up azure. But now we need to port it to an actual existing mobile app and web api app. The mobile app can get the Bearer token, but when we pass it to the web api, we pass this in a CSOM request as follows, but we still get a 401 Unauthroised response. public static ClientContext

SharePoint JavaScript CSOM: Best way to deal with Lookup fields?

天大地大妈咪最大 提交于 2019-12-13 06:41:25
问题 I'm new to CSOM (I've used SPServices up to this point), and I'm trying to learn the basics to getting list items. I have a list with lots of columns, several of which are lookups to other lists. When I try to get and print out one of the lookup columns, it comes out as [Object object]. I'm guessing that the lookup fields are getting returned as objects that contain the whole entry from the lookup list. Is that correct? If so, what's the best way to get the fields that I want to display from

jQuery Deferred and promise - Error: Object doesn't support property or method 'then'

送分小仙女□ 提交于 2019-12-13 00:38:58
问题 I'm probably missing something really basic here but I can't seem to find the error and it's getting frustrating. I'm just trying to pull the lists (and then items, but one thing at a time here) from my dev SharePoint site. I've got the first deferred method built and the console log shows that it completes, but then I get "Error: Object doesn't support property or method 'then'" as though jQuery is failing somehow. For reference I'm trying to follow the method described here: http://www

SHAREPOINT 2013: How can I update a Site Column with the content of an array with javascript CSOM?

我怕爱的太早我们不能终老 提交于 2019-12-12 09:02:34
问题 I'm relative new to Sharepoint 2013, I'm trying to update the content of a Site column with the content of an array, I can retrieve and visualize the content of my site column, the user is able to change and save the necessary part and the changes are saved into an array, now I have to update the content of the site column with the content of the array, but for some kind of reasons I can't accomplish that, any suggestion/example? This is my code so far to retrieve, visualize the site column

How to delete a site-column reference from a content-type in Sharepoint Client model

拜拜、爱过 提交于 2019-12-12 00:02:00
问题 I am trying to delete a site-columns from the sharepoint website directly from my code. These site-columns are currently referenced under some content-types. So when I execute a code //Delete the site-column conFields.DeleteObject(); clientContext.ExecuteQuery(); break; it throws an exception Site columns which are included in content types cannot be deleted. Remove all references to this site column prior to deleting it. Can anyone please suggest a way to first remove that reference from the