Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
1k views

Client object model always returns 0 items from list

I am running a very simple Console Application to test SharePoint 2010 client object model. Here is the code using System; using Microsoft.SharePoint.Client; class Program { static void Main() ...
2
votes
2answers
1k views

Set Welcome Page using Javascript only?

Is it possible to set the Welcome Page of a SubSite using only Javascript? I'm looking to create an Onclick Event that does this. Anything would help.
0
votes
1answer
610 views

Equivalent of GetRolesAndPermissionsForCurrentUser in SharePoint REST API?

I have this code which is used to check if a user has permissions to access the site or not. jQuery.support.cors = true; $().SPServices({ webURL: sites[index], ...
0
votes
0answers
38 views

Programatic access to sharepoint with CSOM with Full Control permission

I would want to create some automation on my site , currently my organization provides only full control access to the site.. is it possible to run CSOM C# code to create list items. since i am part ...
2
votes
2answers
3k views

'System.Net.WebException' occurred in Microsoft.SharePoint.Client.dll

While running Sharepoint Client Side Scripting in Visual Studio getting error at the end of ExecuteQuery() It throws an unhandled exception of type 'System.Net.WebException' occurred in ...
1
vote
4answers
9k views

Why this code is not working in CSOM: “new SP.UserProfiles.PeopleManager(clientContext)”

This is the code which is not working. I have this code in my dispForm.aspx. <script type="text/javascript"> var personProperties; function getUserProperties() { var ...
4
votes
2answers
3k views

Get quick launch using CSOM (JavaScript)

On my publishing site I have changed its current navigation (quick launch) to use structural navigation, showing all items under current site. I see that the quick launch shows pages and sub sites for ...
7
votes
4answers
8k views

Is it possible to create site collection using CSOM?

I have been trying out to create site collection using CSOM but unable to fins and class which creates site collection. I have read in MSDN that CSOM runs as site collection scope hence creating site ...
4
votes
2answers
10k views

ReferenceError: SPClientTemplates is not defined

I am trying to use the client-side People Picker and I can't get it to initialize the people picker due to SPClientTemplates not being defined. I am following MS documentation line by line but cannot ...
17
votes
5answers
49k views

ExecuteOrDelayUntilScriptLoaded not executing after page publish

In SharePoint 2013 I have a page that is using the Script Editor web part. In the script editor web part I have the following: ExecuteOrDelayUntilScriptLoaded(startIt, "sp.js"); function startIt() { ...
95
votes
13answers
48k views

How do I know if the page is in Edit Mode from JavaScript?

Is there a way to find out if a page is in Edit Mode from JavaScript? I know server-side can be found using SPContext.Current.FormContext.FormMode but I can't find any means of doing it from ...
0
votes
1answer
70 views

Cannot access SharePoint online _layouts pages using powershell

Would appreciate some help here. Using the following powershell code I can access all Sharepoint online web pages but for any page containing _layouts I get: Exception calling "DownloadString" ...
1
vote
2answers
2k views

Slow running Managed Client Object Model application

I have an application that I built using the Managed Client Object model that performaing poorly and I am curious if I am doing something wrong. The application drills down throw a hierarchy of three ...
1
vote
1answer
781 views

CSOM list item manipulation

Short and sweet : I'm parsing an XML document and adding new job openings into a sharepoint list as well as deleting them if the job id's and deleting them if the particular job id is not present in ...
1
vote
1answer
776 views

Object doesn't support property or method 'readAsBinaryString' IE 11

I am using xlsx.core.min.js to upload excel files to SP and pass their contents to a new list. I have it working in Edge but it will not work in IE 11. The first console error I received was "Object ...
4
votes
1answer
1k views

Enable External Sharing Programmatically

We have a scenario on which we are creating site collections from a provider-hosted app. Some of these site collections will be used by external users. Is there a way from CSOM (server-side) to enable ...
5
votes
6answers
10k views

SaveBinaryDirect Throws Unauthorized When the Client Object Model Works fine

I have decided to use the SaveBinaryDirect Method to upload documents to the sharepoint site due to not having the request/file size limitations that the client object model has. The application does ...
5
votes
1answer
2k views

How to retrieve webpart xml-definition programatically

I have a Custom Webpart deployed in the Site, to which I need to retrieve the XML definition programmatically using Client side object model, can anybody help? EDIT: I used the following code. ...
7
votes
3answers
7k views

REST API + Expand Recurring Calendar Events?

Is there a way using the REST API (through javascript) to expand recurring calendar items? Or is there a helpful client side utility to assist with this?
4
votes
3answers
17k views

CSOM move the files one folder another folder

I have to all files from one folder another folder using CSOM and C# Thanks for your replay Huge Wood my code is below var targetSite = new Uri("https://hello.com//teams/Worldwide_Site"); ...
1
vote
1answer
115 views

Windows Phone 8: SharePoint Online Authentication via ADFS

I'm trying to develop a Windows Phone app using Windows Phone 8.1 SDK and Microsoft SharePoint SDK for Windows Phone 8. I was able to successfully authenticate against a normal SharePoint Online site ...
1
vote
1answer
63 views

How to get client assemblies within a Non SharePoint Machine?

I am running CSOM code in PowerShell to access data of SharePoint 2013 sites. I am adding below lines to load the DLLs in my machine. These lines expect these DLLs to be present in this location. Add-...
1
vote
1answer
4k views

executeQueryAsync synchronously in each loop for sharepoint javascript model

I am performing looping in javascript for sharepoint. I want it to perform synchronously, means only after first data execution is done it should start with second. If first data execution is ...
1
vote
0answers
67 views

Installing a Remote Event Receiver Add-in - System.IdentityModel.Tokens.SecurityTokenException

I'm working with a Remote Event Receiver Add-in in SharePoint Online and when I try to install the Add-in the breakpoint at the HandleAppInstalled(); fires, but when it tries to use ClientContext to ...
0
votes
1answer
162 views

Floating button to submit new list item

I am trying to find information on creating a button that I can have "float" at the bottom right or left of a SharePoint page that when clicked will open a dialog box for a new list item to be saved. ...
0
votes
1answer
40 views

TaxonomyInternalService.GetSuggestions Microsoft.Sharepoint.Client equivalent

With the TaxonomyInternalService.json/GetSuggestions endpoint, I can retrieve all terms with synonyms that start with some specified text. I am attempting to do this with Microsoft.SharePoint.Client....
1
vote
0answers
40 views

Save document template from AppWeb to HostWeb document library

I am trying to create SharePoint app. Basic idea is to create document in hostweb document library from AppWeb (document template stored in AppWeb doc lib). In Details : I have created ribbon ...
0
votes
1answer
97 views

Is there is any way to create popup form on button click in SharePoint Add-In

I am trying to create popup form on button click when i click on "create document" button then popup will be open and on that popup form i need one text box and button. please let me know how can i ...
0
votes
1answer
22 views

problem with deleting and creating same look up field in a picture library

in my project, there is a picture library with a look field. I delete and create this lookup field like that : function MajBibliPhotoGare() { var clientContext =SP.ClientContext.get_current(); ...
0
votes
2answers
586 views

query calender list so user cant book same date and time

Update var context= SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists(); var targetList; function createItem() { targetList = list.getByTitle('...
1
vote
2answers
4k views

Copy all items in a folder to another location

How do I copy all items from one folder(include sub folders and all files) to another folder or location? I have to copy all items to one folder another folder by using C#
1
vote
1answer
14k views

Load properties of list item dynamically in CSOM

I have a situation where I need to load items from the list and which columns to be loaded cannot be hardcoded, as it will be decided on user input. I have the following code: ocamlQuery.ViewXml = "&...
0
votes
3answers
121 views

Call a executeQueryAsync function inside success of a function

I am able to fetch single SharePoint List using JavaScript. But here I need to Query other list based on the value fetched from first list. I have also used angularjs for the page. Find the below ...
7
votes
2answers
5k views

Create a document set with JSOM

I'm trying to generate document sets on the fly with the following code. It is using /_layouts/15/SP.DocumentManagement.js for the SP.DocumentSet.DocumentSet.create method which takes four parameters. ...
3
votes
4answers
2k views

Need a way to identify files which have no checked in version

I wrote a script that traverses a collection, it's document libraries and gets a list of all files. I'm trying to find all the documents which do not have a checked in version and require a user to go ...
1
vote
1answer
1k views

Refresh parent page after closing list item dialog

I'm trying to refresh the parent page of a list when closing the dialog of a list item. Is there a way to achieve this with javascript somehow? I inspected the button in the DOM and tried to write a ...
3
votes
1answer
5k 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 ...
1
vote
1answer
755 views

How to use CSOM TermSet.GetTerms method? Receiving strange null error

I have a piece of code in which I want to check if a specific Term is available within a TermSet. The TermSet is quite large, so getting all Terms is no option here. My code looks like this: Getting ...
1
vote
1answer
94 views

How to bind SP.PermissionKind Enumeration to a dropdown list using jquery

I need help as I have a requirement to get all permissions (PermissionKind Enumeration)and bind it to a drop-down. Also, I need help to know what are the different ways to bind Enumerator value using ...
1
vote
1answer
26 views

SharePoint Client Object Model - Javascript or .Net?

We currently have a SharePoint 2010 environment and planning to migrate to SP 2016(Q2 2019). For SP 2010 we have developed a component to developers that want to consume SharePoint infrastructure. ...
5
votes
3answers
6k views

SharePoint 2013 APIs for anonymous and/or mobile access

In SharePoint 2013 (Preview), does any of the APIs (csom, REST, etc.) work with anonymous access? With mobile access? I haven't found any reference to this in the documentation. I did a quick test ...
2
votes
2answers
1k views

Add a new item that's a Multiselect in sharepoint CSOM

I am trying to add a new list item into a sharepoint 2010 list using the client side object object in C#. I'm having an issue trying to set multiselect values. I saw online to set the values in an ...
2
votes
3answers
1k views

Get publishing page url using CAML

I am retrieving pages using CAML, and doing for loop on the results like the following: function _onSucceed(){ var html=""; for(var i = 0; i <results.length; i++){ ...
12
votes
7answers
44k views

HTTP 401, Unauthorized using the Managed Client Object Model

I have a Windows 7 system built (per MS' instructions) with SharePoint 2010 Server. I'm writing a simple console application on it that attempts to use SharePoint's Managed Client Object Model to ...
6
votes
4answers
6k views

How can one create a custom list in JSOM based on a custom list template (STP) in 2013?

I have a custom list template (STP) in my list template gallery. I can retrieve the list template using the client object model in javascript. But it's not clear how to create a new list from that ...
0
votes
2answers
341 views

get items from a image library and bind using foreach loop with multiple HTML image ID using JSOM

I am trying to create an image slider using JQuery where I am facing difficulty to bind multiple images to HTML labels. As I have already used in while loop how to use this using for each loop to ...
3
votes
2answers
6k views

I want to get list of all site collection available on SharePoint Server 2013 using CSOM or REST API but not server object model

I am working on client application for which I don't want to use Server Object Model of SharePoint 2013. I am ready to go for anything other that SOM. I want to get a complete list of site ...
1
vote
1answer
7k views

C# SharePoint 2013 client object model list item attachment update Error: version conflict

my requirement is I need to update the list item values and if list item contains attachments I need to override with the attachments, delete unused attachments from list item. when I am trying to ...
3
votes
1answer
1k views

GetListItem - Get Distinct Values for Dropdown

I am Passing the XML for getting List item and binding to dropdown. Here i have shown the code.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/...
0
votes
1answer
260 views

PropertyOrFieldNotInitializedException on SharePoint Online CSOM

I am trying to write a simple Console Application in .NET using the CSOM object model. I write the following code (omitted the client context declaration and the authentication parts from below): ...