Questions tagged [sharepoint-clientobject]

API to interact with SharePoint data remotely from script that executes in the browser

Source: Client object model resource center | SharePoint 2010: The new .NET managed, Silverlight, and ECMAScript (JavaScript, JScript) client object models in SharePoint Foundation provide powerful ways to interact with SharePoint data remotely from script that executes in the browser, from Silverlight applications, or from .NET client applications. These APIs include a subset of the features available in the server object model, providing access to objects at the site-collection level and lower within the SharePoint hierarchy.


SharePoint 2013 client APIs provides SharePoint client object model to retrieve, update, and manage data in SharePoint 2013. SharePoint makes the object model available in several forms:

  • .NET Framework redistributable assemblies
  • JavaScript library
  • REST/OData endpoints
  • Windows Phone assemblies
  • Silverlight redistributable assemblies

synonyms: client-object-model

281 questions
24
votes
1 answer

How to use credentials to connect to a SharePoint list using the Client Side Object Model?

I need to write an application to update a list on a SharePoint 2010 site. I found the "SPSite" which I can create with the URL, but I can't figure out how to specify with which user I want to connect. The user isn't the current windows user, and…
J4N
  • 19,480
  • 39
  • 187
  • 340
17
votes
7 answers

One or more field types are not installed properly. Go to the list settings page to delete these fields

CamlQuery query = new CamlQuery(); query.ViewXml = @"" + "" + "" + fileName + "" + "" + "" + "" +…
kevin
  • 13,559
  • 30
  • 79
  • 104
14
votes
1 answer

Web.GetFileByServerRelativeUrl throws "Value does not fall within expected range"

I have a SP Online site where I store Documents, I have no issues adding/retrieving documents but in the delete flow I get an error during retrieval of a File object. public static void DeleteDocument() { using (ClientContext ctx =…
morteng
  • 1,133
  • 2
  • 9
  • 22
11
votes
2 answers

Delete all rows in sharepoint list using Client Context and CAML Query

I am new to SharePoint and want to delete all rows in a SharePoint list using C# ClientContext class and CAML Query. How can i achieve it efficiently?
10
votes
2 answers

Optimal/preferred way to call 'SP.ClientContext.executeQueryAsync' in SharePoint

I have been learning client-side object model and came across the method executeQueryAsync. I found there are quite a few ways to call this method. Some of the one I found were these: var context = new SP.ClientContext.get_current(); // Option…
Naveen
  • 6,786
  • 10
  • 37
  • 85
9
votes
1 answer

When renaming a file in SharePoint via client object model, the filename gets trimmed if there's a dot in between

I wrote a small application using the SharePoint client object model, which renames all files inside a SharePoint 2010 document library. Everything works well, except if the filename should contain a dot somewhere in between, it get's trimmed,…
Pandora
  • 233
  • 1
  • 6
  • 15
8
votes
1 answer

"Encoded" login names in SharePoint Client Object Model

I'm writing a small .NET proof-of-concept console app that performs a series of actions on a SharePoint document library. I noticed that the following methods expect an "encoded" login name - that is, login name including provider information, e.g.…
bernhof
  • 6,219
  • 2
  • 45
  • 71
8
votes
2 answers

Create Document Library using Client Object Model

Just a quick question, is it possible to create a Document Library using the Client Object Model in SharePoint 2010? I know you can create lists etc. Am I right in saying that a Document Library is just a 'special' type of List? How can I specify…
Josh Price
  • 259
  • 3
  • 9
  • 18
8
votes
3 answers

Programmatically get ListItemVersion using client object model SharePoint 2010

I have a scenario where I have to move all my data in a SharePoint 2010 list (name= "VersionTestList") to a SQL server database. Since versioning is enabled in the list, I want to move the previous version details too. Anyway I was able to move the…
Febin J S
  • 1,358
  • 3
  • 26
  • 53
7
votes
4 answers

Updating Field Value in SharePoint Using Client-Object Model

So I am trying to create a method that is essentially used to change the value of a field in SharePoint. This is what I have so far... static String fieldName1 = "Title"; static String fieldName2 = "Keywords"; static String title = "A Beautiful…
This 0ne Pr0grammer
  • 2,632
  • 14
  • 57
  • 81
7
votes
7 answers

Namespace 'SharePoint' does not exist in the namespace 'Microsoft'

So I am starting to learn C#, like literally just started learning, and coming from a Java background, it doesn't look too bad. However, I have a question. I am following THIS tutorial on using the client-object model. And just starting from the…
7
votes
4 answers

SharePoint 2010: JavaScript error when creating Modal Dialog?

For some reason, my SharePoint's modal dialog doesn't work properly. The error I get is this: In Firefox: SP.UI.$create_DialogOptions is not a function In IE: Object doesn't support this property or method Here is my code: var options =…
Moon
  • 33,439
  • 20
  • 81
  • 132
6
votes
3 answers

Create CSOM ClientContext with re-usability like singleton pattern

I have multiple methods being called on different user actions which is using ClientContext. Creating it on every method execution was causing performance issue. So I added it as static variable for re-usability, the performance improved with an…
Amna
  • 603
  • 7
  • 30
6
votes
2 answers

Create folder on SharePoint document library using client object model

I want to create folder on SharePoint document library using client object model (C#). Below is the code which does that. ContentTypeCollection listContentTypes = list.ContentTypes; clientContext.Load(listContentTypes, types => types.Include …
User5590
  • 1,383
  • 6
  • 26
  • 61
6
votes
4 answers

"The property or field 'Id' has not been initialized. It has not been requested..." when trying to access GUID of Library in SharePoint via JavaScript

I am trying to access the ID of Library using client-side object model in SharePoint 2013. But I am getting error as: The property or field 'Id' has not been initialized. It has not been requested or the request has not been executed. It may need…
Naveen
  • 6,786
  • 10
  • 37
  • 85
1
2 3
18 19