Questions tagged [client-object-model]

API for interacting with SharePoint from .NET, Silverlight, and JavaScript.

348 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
31
votes
0answers
3k views

Use CSOM with ADFS credentials from Single Sign-On enabled ASP.NET MVC app

I have the following setup: ADFS 3.0, SharePoint 2013 and the custom ASP.NET MVC app. Both SharePoint and MVC app are configured to use Single Sign-On from ADFS, so once user is logged in via ADFS, ...
8
votes
0answers
3k views

Check given user's listItem permissions with SharePoint 2010 Managed Client Object Model (c#)

Is it possible to determine if a user can access a given item identified by its url without the users context - it has to be done with CSOM. Code so far: var file = web.GetFileByServerRelativeUrl(...
8
votes
0answers
415 views

Design Package import SharePoint 2013 using App Installed event CSOM

In SP2013, I am trying to import and export the design package from one site to other site using AppInstalled event using CSOM. I am not able to get the context of source site to import the design ...
7
votes
2answers
4k views

How to change 'Modified By' column value when a new file is uploaded in SharePoint 2013 using Client Object Model?

I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The ...
6
votes
2answers
3k views

set multiselect lookup column using jquery

I have a Multi select Look up column which as you all know is a control with two list boxes and "Add or Remove" Buttons. The user populates the right-hand side of the control with some values by ...
5
votes
0answers
172 views

How to provision External content Type using CSOM

Is it possible to provision External Content type and list using CSOM?
5
votes
1answer
1k views

Dynamically create metadata and associate it with File using Client Object Model

Is there any way to dynamically add metadata in the upload file. I am using the following code in this regard. File uploadFile = context.Web.GetFileByServerRelativeUrl(location); //check out to make ...
4
votes
0answers
790 views

How to specify additional CSOM properties to load in a PowerShell script?

In a PowerShell script, I'd like to retrieve the url of the content type hub tied to a site collection. My scripts muse use the CSOM. I tried : $Context = New-Object Microsoft.SharePoint.Client....
4
votes
0answers
364 views

Handling concurrency in SharePoint Client Object Model

I'm currently working on an enterprise portal built completely using provider hosted apps, ECMA CSOM and .NET client object model. We are almost at the end of our development phase and we started ...
4
votes
0answers
743 views

Replicate AllItems.aspx inline edit in custom page layout

I am attempting to replicate the inline editing features found in the allitems.aspx page in a custom page layout. For whatever reason the "new" and "edit" list options don't seem to be showing up. ...
4
votes
0answers
511 views

Open Quick Launch link in new window (CSOM)

How to add a link opening in a new window/tab to the quick launch menu using CSOM? There is some discussion about the server-side here and here but they are dealing with the Properties collection of ...
4
votes
0answers
588 views

Querying 'Append Changed to Existing Text' from client script?

Is there a way, preferably via REST but JSOM would work, to query a SharePoint 2010 field to get all entries when 'Append Changes to Existing Text' on a multiple lines of text field is enabled?
4
votes
0answers
438 views

How to access Page layouts and site templates using CSOM?

How to access Site Settings > Look and Feel > Page layouts and site templates using CSOM? The page allows end users to change these settings: Subsite Templates: subsites can use any site template or ...
4
votes
0answers
2k views

SSL certificate error when using Client Side Object Model

I wrote an app that gets information from some Sharepoint 2010 lists and displays it to the user. It works fine on my development machine.But when I copied the exe to another desktop machine I got the ...
4
votes
2answers
7k views

Specify item fields to Load using SharePoint 2010 Client OM

How can I dynamically generate/specify a list of item fields I want to load when querying a list using the Client OM? This is possible to do using the tag on the CAML query, but this loads additional ...
3
votes
0answers
87 views

SharePoint Online: Skip Property doesn't work with Order By in paging using CSOM

I am trying to fetch the contents of Document Library using paging. For this, I am skipping the resources using ListItemCollectionPosition and getting maximum resources using <RowLimit> in ...
3
votes
1answer
3k views

CSOM The request uses too many resources error while provisioning web

I am provisioning web on SharePoint online using following CSOM code(provided hosted app), but intermediately we are getting "The request uses too many resources" error. using (ClientContext ...
3
votes
1answer
3k views

Sharepoint client object model {File not found}

var onlineCredentials = new SharePointOnlineCredentials(ServiceUserName,securePassword); var context = new ClientContext(clientUrl); context.Credentials = onlineCredentials; ar cc = GetAllFiles(...
3
votes
0answers
191 views

SharePoint Client Object Model authentication issue

I am using SharePoint.Client to connect to a SharePoint website. The first time it works, but after that I get 401 : Unauthorized error. using (ClientContext context = new ClientContext(...
3
votes
0answers
287 views

SP.ClientContext.Load suddenly throwing uncaught TypeError?

I am trying to start a workflow from JSOM. I just had it working fine, and then I had to change some of the other code in the JavaScript file that is unrelated to the client context or executing ...
3
votes
0answers
332 views

How can we programmatically add a hyperlink and text to a multi-line text field?

I have a SharePoint list which has a multi-line text field. Can we add a hyperlink and simple text along with it, inside that particular field using the client object model? If so can someone help me ...
3
votes
0answers
294 views

How to dynamically change the drawing path in Visio Web Access Web Part

I am wondering if there's any way to dynamically change the drawing shown by a visio web access web part. I have multiple drawings I want to show on a page based on what users click on the page. Any ...
3
votes
2answers
887 views

Get object of ribbon button in JavaScript

I am trying to access the ribbon button via JavaScript. Below is my code: // Get the page manager var ribbonPageMgr = SP.Ribbon.PageManager.get_instance(); // Get the ribbon var ribbon = ...
3
votes
0answers
654 views

JSOM working in Chrome but not IE

I am learning the Java CSOM at the moment and have written a little program that creates a sub-site and assigns a masterpage to it. I am embedding all the code directly on the page. I am finding ...
3
votes
0answers
101 views

Client WebPart (apppart), I need to explain some settings

Property element <Property xmlns="http://schemas.microsoft.com/sharepoint/" Name="Text" DefaultValue="Text" Multilingual= "true" | "false" PersonalizationScope="user" | "shared" ...
3
votes
1answer
1k views

502 DNS lookup failed error when using SharePoint 2013 CSOM

I am facing an issue while using CSOM in SharePoint 2013. I have configured an alternate access mapping for our site to run on http://mycustomdoamin.net/ The site is running fine and I am able to see ...
3
votes
2answers
95 views

Create a folder and add properties (field values) to it on form submission

I have created a simple form on SP site, on the submission of which a folder with entered name in the form would get created in the desired doc library.Library has some custom columns such as ...
3
votes
1answer
6k views

clientContext.Credentials = CredentialCache.DefaultNetworkCredentials - in CSOM returns 401 unauthorized thru IIS

I am trying to access SharePoint site using CSOM with Windows Authentication. It works if I run it in Visual Studio on a server. However, it returns a 401 unauthorized when I run the site through IIS ...
2
votes
1answer
722 views

Execute CSOM code from .net core

Is there any option to execute CSOM code from .net core application? I have a bot solution from this i need to store all the conversation details in SharePoint list. When executing the code, i am ...
2
votes
0answers
16 views

Save file in same document set it is opened from

I have a request from a customer I am struggling with. Given is the following scenario: SharePoint Server 2016 Whenever a new document set is created a specific Excel file is added to the document ...
2
votes
0answers
47 views

Java Script How can I get the Site Owners information and the Group Name for all my sites

I have zero experience coding in SharePoint and have been given the task of showing the current Site owners within an HTML control on EVERY page for our site. I found this code at this link which ...
2
votes
0answers
282 views

Authenticate user in embedded iframe using session of current SharePoint user

I have an iframe with my web application embedded to a SharePoint page. I need to somehow authenticate him/her in this web app using Microsoft Azure AD without forcing him/her to enter login and ...
2
votes
0answers
324 views

sharepoint online authentication using javascript object model

I have a local html page which contains javascript code that uses client context. I can run the code in sharepoint environment but i want to run it in my local html page, which is restricted due to ...
2
votes
0answers
518 views

could not access library via CSOM/REST API if end user only has permission on the library but not the web level

This is on SharePoint Online and here are the env setup: Site collection: https://xxx.sharepoint.com/sites/sitecollection1 - End user has Permission Subsite: https://xxx.sharepoint.com/sites/...
2
votes
0answers
46 views

Desktop application needs to support all versions of SharePoint and SPO

I am connecting to the different SharePoint environments using the CSOM. Whats the best way to deploy the available DLLs to support all SharePoint environments? Do I need to dynamically instantiate ...
2
votes
1answer
151 views

Javascript object model says load succeeded, but object is empty?

I've got a pretty weird issue going on on a clients SharePoint 2013 environment. We're using some JSOM javascript code to retrieve details from a web. Here is a snippet of the code: function ...
2
votes
0answers
266 views

Save a SharePoint 2013 workflow as template using code behind

We have around 100 SharePoint 2013 workflows in our Farm. We need to save these workflows. It is tedious to manually open Sites in Designer and go to each workflow and store it as a template. Is there ...
2
votes
0answers
363 views

Activating a Web-scoped Feature using SharePoint 2010 CSOM fails with ArgumentException on featDefScope

I'm trying to activate a Web-scoped feature using the Client Object Model in SharePoint 2010. The code works when activating a feature in SharePoint 2013, but when run against SharePoint 2010, I get ...
2
votes
1answer
153 views

Use a colleagues' browser settings to detect their time zone and update the date format and time to reflect the time in their time zone

In the Events web part, the date displayed should reflect the date for the event based on the user’s time zone. Can this be achieved by client side This is the sample events webpart: I have till ...
2
votes
0answers
582 views

unexpected response from server

I am using javascript to load data from list. But every now and then i get error Unexpected response from server Sometimes i get and sometimes i dont. I googled and someone suggested to free memory ...
2
votes
0answers
507 views

People Picker in sharepoint 2010 in Client Object model

I want to implement a people picker functionality in sharepoint 2010 with Client Object Model (JSOM), how to do it? Actually i have implementated in 2013 but the same code does not work on 2010.
2
votes
1answer
367 views

Difference between Publishing site and Team site while loading SP.JS

I would like to know what is the difference when loading SP.JS file in Publishing site and Team Site. SP.SOD.executeFunc('sp.runtime.js', 'SP.ClientContext', function () {}); SP.SOD.executeFunc('sp....
2
votes
0answers
228 views

SharePoint Online - custom ribbon tab on all pages

Is there a way to make custom tab available on all pages of SharePoint Online website? For SharePoint Farm solution you can register a Delegate Control and activate it on a server side like this: ...
2
votes
1answer
949 views

Get Sharepoint Permissions\Roles (custom) of a user from AD Group that is part of SP Group via CSOM

SharePoint 2013 + provider-hosted app. User is part of AD group. AD group is part of Sharepoint group. Sharepoint group has custom security permissions assigned. How do I check whether user has some ...
2
votes
1answer
1k views

Does audiences work with CSOM?

If we build an SharePoint app and need to show items based on audience targeting, can we use CSOM for that? Can't find any references to it in the CSOM SDK.
2
votes
1answer
450 views

Enable item scheduling on a publishing library via SharePoint .NET client API

Does anybody know how to enable item scheduling on a publishing library via code (.NET Client API)? This can be done via the Settings UI for the library in Manage Item Scheduling. However, I can't ...
2
votes
0answers
397 views

How to execute a SQL Agent Job on a button click in a Web Part page of a SharePoint 2013 site?

I have a SharePoint 2013 on-premises site. The requirement is to add a button to one of the Webpart pages and on click of that button, a sequence of 3 consecutive SQL Server Agent jobs will be ...
2
votes
0answers
1k views

Update ID field with client object model

I'm trying to create items in a list and set the ID field programmatically (for use in a lookupfield in another list). This works serverside by setting the property ReadOnlyField of the field ID to ...
2
votes
1answer
1k views

SharePoint 2010 Javascript JSOM creating a List View Web Part using javascript

I was able to follow along and add a Content Editor web part to a page using javascript from MSDN here. I am now interested in trying to find a way to add a List View or Data View web part to a page ...
2
votes
1answer
455 views

Why is there a delay in Actual Permissions when adding a user to a SharePoint group with CSOM

I have site that has unique permissions. I have a SharePoint group that has permissions for that site. If I add a user to the SharePoint group through the SharePoint UI, the user can immediately get ...