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

learn more… | top users | synonyms (1)

4
votes
1answer
7k views

How to get all fields of a list using JS Client Object Model

Is it possible to retrieve all fields of a list (or default view) through the JavaScript Client Object Model and filter the fields on type (e.g. I only want the Choice fields). var clientContext ...
0
votes
2answers
251 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() ...
13
votes
5answers
4k views

WebServices or Client object model?

I am writing a Silverlight control which will display the data from SharePoint list for use in SharePoint 2010 site. I am considering wheather to use Client Object Model or SharePoint web services ...
1
vote
1answer
243 views

Error while downloading Lists in a spweb

Here is the code private void downloadList(SPObjectData objectData) { using (SPWeb currentWeb = objectData.Web) { foreach (SPList list in currentWeb.Lists) ...
1
vote
1answer
125 views

Cannot create site in different web application - Silverlight Client Object Model

I am developing a Silverlight application. It interacts with SharePoint 2010 using SharePoint Silverlight Managed Client Object Model. One of the application functionalities is to create a ...
1
vote
3answers
2k views

ClientContext cannot contact site at specified url

Im doing a simple connection to a sharepoint 2010 site using clientcontext and im getting the error "cannot contact site at specified url". The site (eg Site1) is a host-header site it was ...
2
votes
1answer
3k views

JavaScript object model - using executeQueryAsync with body.onbeforeunload

I am trying to write some code that updates a list item when a list edit form (EditForm.aspx) opens and closes. I have written a function and assigned it to the onload and onbeforeunload events of ...
1
vote
1answer
546 views

Add numbering to a standard list view

We're displaying a SharePoint 2010 list using a Standard View created via the browser. The items are shown in a table and the users would like a number shown for each row. The numbers column would be ...
1
vote
2answers
592 views

Getting the error “The underlying connection was closed: An unexpected error occurred on a receive.” using Client Object Model

I'm trying to connect to a SharePoint 2010 site using the .NET Client Object Model. When I run test code from a windows console app that I have written, I have no problems. When I try to run the same ...
3
votes
2answers
2k views

Getting the GUID of a file with client object model?

Is it possible to get the GUID if I have the path to a file? Any sample code available?
0
votes
2answers
755 views

Is there any way to access a managed meta data service using only javascript in SharePoint 2010?

I am creating custom forms in a SharePoint site. The only thing is most of our Lists contain managed metadata fields. I have been successful in adding new items to Lists having only standard fields ...
1
vote
1answer
287 views

How to access custom properties of a user in SharePoint client object model?

I have a set of users in my SharePoint site with a few custom properties like GUID, LOS, YOS etc. My application needs to access the user custom properties and do CRUD operations on the properties. I ...
6
votes
4answers
16k views

Get Site Collection full URL using javascript

I want to get the URL for my site collection. One way I thought I could do it was using the window.location in javascript and getting it that way. I know that you can use ECMA script and the client ...
6
votes
2answers
2k views

How to create SharePoint list with custom template using Managed Client Object Model?

Creating lists in SharePoint using Managed Client Object Model is rather easy task. Here's how to create a list with SharePoint's custom list template: ListCreationInformation lci; List list; lci = ...
1
vote
1answer
1k views

How to check if current folder in document library has child items via JavaScript client object model?

I have a custom button on ribbon, which performs some action with current folder (download folder content as zip package). I want to disable this button in case if current folder doesn't contain any ...
1
vote
1answer
390 views

Windows Application to access the list in a Sharepoint Site using Client Object Model

I have created a Windows Application, which uses Client object model to access lists in a Sharepoint site(installed and configured on a separate server). I have used the default credentials to access ...
3
votes
3answers
3k views

Javascript to get GUID from SharePoint

I am newbie to SharePoint and I am uploading a file to the server using javascript. Now the task is to get the GUID of that file and display it ({alert(guid); is fine). I don't even know where to ...
4
votes
3answers
4k views

How to get SP.Folder for SP.ListItem in SharePoint 2010 JavaScript Client Object Model?

I have a custom button on ribbon for document library and need to disable it if current SPListItem is an empty folder. To disable button I use EnabledScript attribute of CommandUIHandler. I can get ...
3
votes
2answers
420 views

Publish contenttype after activating feature (Office 365)

I've created a Contenttype and some fields in a visual studio project. They are deployed when activating the "Content types"-feature. But here's the problem: I want them to be deployed to the Content ...
3
votes
2answers
2k views

Programmatically add Event to Sharepoint Calendar using Client OM

I need to programmatically add events to a SharePoint Calendar and make them repeatable using JavaScript Client Object Model (without any c# code). Does anybody have ideas how can I implement this ...
1
vote
1answer
434 views

How to add attachment to new item silverlight client object model

I am trying to add an attachment to new item but I could only succeded to upload the attachment into the list's folder (not to list's attachment folder). How can I achieve uploading the attachment on ...
4
votes
1answer
865 views

How to add rich text content programmatically using Managed Client Object Model?

I am building a Silverlight application that interacts with SharePoint through Managed Client Object Model. One of the functionalities of the app is to update a list item field with rich text content. ...
2
votes
1answer
2k views

How to upload a file larger than 2MB to SharePoint document library using Managed Client Object Model for Silverlight

I can't seem to upload a file to SharePoint if that file exceeds 2MB or so. I am developing a Silverlight application that is interacting with SharePoint via Managed Client Object Model for ...
1
vote
1answer
260 views

How to cancel pending actions in Client Context? (Managed Client Object Model)

I have written a code relying on Managed Client Object Model which performs the following actions: Creates a site Web site Creates a list List list1 Creates a list field FieldText field1 (which is ...
4
votes
2answers
224 views

Is there a way to determine if the SharePoint version is 2007 or 2010 using Managed Client Object Model?

I am building an application that interacts with SharePoint 2010. It is a Silverlight application built on the Managed Client Object Model. The application is set up on SharePoint like this: User ...
3
votes
3answers
10k views

Getting the URLs of the SharePoint sites, lists and list views using Managed Client Object Model

Let's say that I have created: A SharePoint site collection at http://mysharepoint/. A subsite of that site collection titled Team site at http://mysharepoint/teamsite/. A list titled My List ...
8
votes
3answers
3k views

How to add list web part to the SharePoint page using Managed Client Object Model?

I am trying to add new web part to the SharePoint page using Managed Client Object Model that will display a list. I can't seem to be able to figure out the code of the web part's XML that is ...
3
votes
1answer
1k 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?
6
votes
4answers
6k views

SharePoint 2010 Javascript Client Object Model cross site collections?

I've read some unofficial things online that using the Javascript client object model to retrieve content from other site collections is not allowed due to prevent the equivalent of "cross site ...
1
vote
1answer
336 views

Cannot cast to clientContext.CastTo<T> (Managed Client Object Model)

I am writing a method that is supposed to create a SharePoint list field. I want to be able to make my method return the newly created field. The problem that I am facing is that ...
1
vote
1answer
366 views

How can i get entire role assignments from SP 2010 using the COM interface including the users in the AD groups and not the groups names?

I've been trying to get all the RoleAssignments using the COM interface. the problem is that i get the AD user group names instead of the actual users inside the groups. my code looks something like ...
2
votes
2answers
2k views

How to add new item in Links list using Managed Client Object Model?

I have created a standard SharePoint Links list, using Managed Client Object Model (for Silverlight). Here's the code: ClientContext clientContext = new ClientContext(sitePath); ...
2
votes
1answer
412 views

Access My Content using ecmascript client OM

Is is possible to access the current user's "My site" and "My Content" using the ecmascript client OM? Specifically I'm looking to create a custom list, that is specific to each user, and wanted to ...
1
vote
3answers
946 views

upload a file with metadata without creating a new version using the client object model

What I'm trying to do is upload a file with metadata without creating a new version using the client object model. I already have this code: byte[] bytes = ...
0
votes
1answer
605 views

Using the Sharepoint Client Object Model with ASP.NET C# page

So why when I add the line <%@ Import Namespace="Microsoft.Sharepoint" %> does the page error with: An error occurred during the compilation of the requested file, or one of its ...
8
votes
1answer
3k views

How to Impersonate Users Via Client Object Model?

I want to insert new SP List items -- blog comments, to be exact -- on behalf of other users. Ideally, I'd just pass a SharepointID for the user, but that doesn't seem to be possible. I think that ...
4
votes
4answers
9k views

Closing a modal dialog using a custom form

I am using some JavaScript (Client OM) code to open a dialog. Here's a snippet: function OpenModalForm() { //snip var opt = { url: url, width: 800, height: 600, ...
0
votes
1answer
720 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 ...
3
votes
1answer
3k views

How do I save files that are larger than 1MB using the Client Object Model?

I'm trying to save a file to an SP document library using the Client Object Model: //populate information about the new file, from disk FileCreationInformation fci = new FileCreationInformation(); ...
7
votes
1answer
4k views

How to get a list of all Choice field options using Client Object Model

How would you get a list of all the possible choices from a choice field (e.g. Task list Priority or Status fields) using javascript client object model?
0
votes
1answer
1k views

Setting a Publishing Hyperlink Field Value that has no Value

I am using the Object Model and the Microsoft.SharePoint.Publishing.Fields.LinkFieldValue namespace in an attempt to set the value of a Hyperlink Column on a SharePoint 2007 Publishing Site. ...
2
votes
1answer
1k views

How do I get a specific file using Client Object Model in Silverlight?

I can't seem to find any direction when trying to filter a FileCollection (Picture Library) by a specific value. I am 'trying' to use the Silverlight Client Object Model to access list data in ...
8
votes
3answers
11k views

How can I use the SharePoint Javascript Object Model from a plain HTML page?

I would like to use the SharePoint Javascript Object Model from a "plain" html page (ie, not an .aspx application page etc.) Is this even possible? If so, what scripts should I reference? I've added ...
1
vote
1answer
79 views

Is it possible to use the Javasciprt client object model from a different web server?

Basically I would like to host an application on a different server than my SharePoint server. Using the managed client object model I have been able to access data on my SharePoint server, but I'm ...
2
votes
1answer
469 views

Client object model thread safety

Is ClientContext thread-safe? I'm using Parallel framework to parallelize some work that creates new items on the list. Example: using(var ctx = new ClientContext(siteUrl)) { var list = ...
0
votes
1answer
154 views

Access different site collection using client OM

I have written a little app, which makes use of the ECMA client OM. I need to access from a site-collection "/sites/subsite" a list, which is located on the site-collection "/". However, this shows a ...
5
votes
1answer
477 views

structure of sharepoint javascript functions

I am trying to understand more the structure of javascript functions in SharePoint. Why does every function begin with som value than colon and semicolon like ULSrE8:; in spgridview.debug.js: ...
1
vote
1answer
3k views

Setting User column value via Client Object Model

I'm trying and failing to set the value of a User column via the SharePoint client model: int userID; string displayName; /* Look up userID and displayName from Web Service here */ ...
2
votes
1answer
71 views

Silverlight application privileges

I have a silverlight application which uses the client object model to access the sharepoint server. When i run the app "out-of-browser" with elevated trust everything works great, but when i try it ...
2
votes
1answer
591 views

ClientRuntimeContext to ClientContext

I was wondering if their is any way to convert ClientRuntimeContext into ClientContext. i am retrieving the ClientRuntime context like this public File uploadBase(Document document, Folder ...