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

learn more… | top users | synonyms

1
vote
1answer
829 views

How can I access the Taxonomy store using the Client Object Model?

We are writing an Outlook plugin and need to create an overview of the available Managed Metadata term stores and terms from clients that connect to SharePoint. I have used the TaxonomySession to do ...
2
votes
4answers
10k views

How to check if a folder exists in a list?

I have the following code: SPFolder oFolder = myList.RootFolder.SubFolders[folderName]; if (oFolder == null) { Console.WriteLine("FOLDER NOT FOUND"); ...
3
votes
1answer
766 views

Permissions error in IE 8 but not Firefox 6.0.2?

I am using the Javascript Client Object model to access some information from a list. Below is the code I am using: function getDeptInfo(id) { //var value = ...
0
votes
2answers
1k views

Get list of web parts on the client-side

Is it possible to use the Client Object Model or jQuery to get a list of the SharePoint 2010 web parts on a certain part of the page, say those in the DIV #main-content? To be more specific, I'd like ...
7
votes
1answer
3k views

Fetch list of sites in site collection into jQuery

Is there a way to get the list of sites in the current site collection into jQuery as an array or other data structure? Thanks.
7
votes
1answer
6k views

Get a value included from a lookup column using the JavaScript Client Object Model

Related: How to retrieve a ListItem using the Javascript Client Object Model? In my previous question I was able to successfully retrieve a basic value from a list item. My problem is that I am now ...
0
votes
1answer
1k views

Close SP.UI.ModalDialog on form submit

I am using the SP.UI.ModalDialog to popup a custom form. The form uses an XSL stylesheet that uses the GenFireServerEvent to commit the data. This works correctly, but I want to close the popup once ...
2
votes
3answers
555 views

Getting item id after inserting with Javascript Client OM

Is it possible to get the inserted item id after executeQueryAsync? Or do I have to send a second query to get the item id?
2
votes
1answer
9k views

How to retrieve a ListItem using the Javascript Client Object Model?

Right now I am using this method: function getWebProperties(id) { var ctx = new SP.ClientContext.get_current(); this.website = ctx.get_web(); this.listCollection = website.get_lists(); ...
0
votes
1answer
119 views

Proper way to retrieve list data asynchronously?

I have done this in the past using jQuery's ajax function and the SharePoint web services, but I'm curious if it is considered a better practice to use the Javascript Object Model? Also, is it secure ...
1
vote
1answer
864 views

How to Union 2 Lists Using ClientContext?

I have 2 lists which both contain identically-named fields that I'm trying to access using C#. Using ClientContext, how can I perform something that does the same thing as a SQL Union to give me one ...
4
votes
2answers
10k views

How to retrieve lookup values using ClientContext?

What's the best way to retrieve lookup values using ClientContext? I'm accessing a list using ClientContext (let's call it ParentList). That list contains several lookup fields (let's call one of them ...
2
votes
2answers
5k views

How do I get the number of items in a list?

I have a list with a lot of items in it I need to know the list item count the following is my code: var sListId = SP.ListOperation.Selection.getSelectedList(); var oWeb = ...
3
votes
3answers
9k views

How to get list by url using client object model?

Is it possible to get list by url using ECMA script client model? For example something like this: context.get_web().get_lists().getByUrl("Lists/MyList"); UPD!: Please, refer to this correct ...
1
vote
1answer
932 views

UserMulti Field limit

Does UserMulti field have a limit on how much users are selected? I'm asking this because when I use client object model I can set at most 15 users at once. edit: I can add more users directly on ...
12
votes
3answers
3k views

Client Object Model equivalent of SPUtility.SendEmail in SharePoint 2010

I am trying to send an email after an action occurs in Silverlight WebPart I am designing. Is there a built-in class in the Client Object Model that can handle this, or will I have to build a ...
0
votes
1answer
362 views

Wrong results returned with Sharepoint Client ObjectModel

I'm using the sharepoint client object model for a small application. When I try to get all folders and items from the "Shared Documents"-library, it doesn't return all folders and files. Code: ...
0
votes
1answer
2k views

SharePoint 2010 - enable custom ribbon button only if user has permission to edit selected item

I have a custom action in a ribbon, and I need to enable the button only if current user has permission to edit the item (Contribute role). The action is defined in a document library, the way it ...
2
votes
2answers
5k views

Error on sp.js property 'isNullOrUndefined'?

When I try to run my javascript SP.JS file in a user control I get this error: Microsoft JScript runtime error: Unable to get value of the property 'isNullOrUndefined': object is null or undefined ...
1
vote
3answers
2k views

Missing fields from SiteUserInfoList user ListItems

I'm using the SharePoint 2010 Client Object Model to retrieve all the users from a SharePoint instance, via Web.SiteUserInfoList: var query = new CamlQuery { ViewXml = "<Query/>" }; var ...
1
vote
3answers
1k views

401 with ClientContext

I am connecting to SharePoint via managed client api. ClientContext connects to the site and access the list data when I specify the site address as http://computer_name but when I give the configured ...
1
vote
1answer
381 views

Help with Silverlight and SharePoint

As a continuation of my last question, I can get the data correctly now just I am having a problem getting it to display. I want it to be in a DataForm control but I seem to be unable to connect it ...
0
votes
2answers
3k views

How to read from a list using Silverlight and the SharePoint 2010 Client Object Model?

I am attempting to write a simple Silverlight webpart that reads information from a list and then outputs it to a data grid. I can get all of the lists, their titles and their field titles fine but ...
4
votes
2answers
4k views

Remove “Add new item” functionality from lists

I have lists where the items are created from nintex workflows. I need to prevent the users from adding list items manually, as the workflows ensure dependencies. Revoking the add item permission is ...
1
vote
1answer
149 views

Client Object Model and 32 bit

While trying out Client Object Model, I was wondering whether will there be any issues if the 'Platform Target' is NOT set to 64 bit? I tried setting the value to 32 bit, even then the application was ...
0
votes
1answer
449 views

Is there a way to get the currently logged user’s colleague list using ECMA client script?

Is there a way to get the currently logged user’s colleague list using ECMA client script? Used the below script to pull the currently logged user name: <script ...
0
votes
1answer
327 views

Using Client OM from an Windows Auth ASP.Net application

I have an asp.net application and a SharePoint application which uses windows authentication and are on the same domain. From the asp.net application, I am making some managed client OM calls to the ...
1
vote
2answers
275 views

External Data: Better to Import into SP Lists or Access Externally?

I have been tasked with creating a report in Sharepoint to display data compiled from multiple external databases. From my experience thus far it seems that a Visual WebPart is the way to go to ...
4
votes
1answer
2k views

How to find the Author Name using SP Client Context in SharePoint 2010?

I am trying to find the Author Name(created by) for a given Item Id using the SP Client context in SharePoint 2010. Below the code snippet var ctx = new SP.ClientContext.get_current(); ...
3
votes
2answers
3k views

Client OM - setting lookup fails

I'm using client object model to migrate data from some external data source. The problem is that when I set lookup (normal list or user) I get: Value does not fall within the expected range. I set ...
3
votes
2answers
2k views

Can I use the SharePoint 2010 Client Object Model with Sharepoint 2007?

Any workarounds or alternatives that work on both SP2010 & 2007. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b4579045-b183-4ed4-bf61-dc2f0deabe47
10
votes
8answers
12k views

How do I determine a user's SharePoint group membership using the client object model?

I want to redirect users from a landing page to another page in SharePoint 2010, based on their group membership. I need to do this using JavaScript (ECMAScript) and not server side code.
50
votes
10answers
23k 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 in on the server-side can be found using SPContext.Current.FormContext.FormMode but I can't find any means of doing it ...
2
votes
1answer
2k views

Document versioning - different doc types

I have a document library with versioning enabled. Documents are now in some other system and I need to migrate them. The problem is thath different verions migth have diffrente file types (doc, docx, ...
2
votes
3answers
3k views

Uploading file version - Client Object Model

I have a library with versioned files. I have versioned files prepared for uploading (1 version = 1 file). How do I create new version? Do I just set file's Content property and Update it? Please ...
2
votes
2answers
1k views

How do I test if I will be able to execute a query (does the site exist)

When I run a (CAML based query) executeQuery against Sharepoint, sometimes the site does not exist (it is created by a workflow process which may not have run). When this happens, I get a ...
5
votes
2answers
1k views

Client Object Model Authentication - Authenticating the Wrong account!

I am using the Client Object Model to interface my .NET App with SP 2010. What I am finding curious is that I am using default authentication, and whenever I make my connection, I am ending up ...
6
votes
5answers
1k views

When I execute a CAML query, how do I know what ListItem details I can include?

I was querying a SharePoint library, trying to retrieve some file attributes. Apparently some things like FileType and Date are not supported, even though those fields are listed as a built in field. ...
4
votes
1answer
3k views

Document Sets and Client Object Model

What are the options to manage documents sets using Client Object Model? I need to create new document sets and upload some files in them...
44
votes
7answers
38k views

How do you get the current list item in JavaScript?

There's all kinds of ECMAScript class library examples around but all of the ones I find show how to retrieve all list items (through SP.ClientContent) but how do you get the current list item? I'm ...
0
votes
2answers
823 views

fill a dropdown with data from a list using client object model

how can i fill a sharepoint 2010 dropdown with data from a list using client object model? i am trying to create an aspx workflow association form and want the initiator to choose an option from an ...
2
votes
1answer
2k views

SharePoint 2010 set a custom page as home page through a feature

I have a WebTemplate using a team site as BaseTemplate, and was wondring how I could set the default page as home page instead of the home.aspx page and this during the provisioning process of the ...
0
votes
1answer
250 views

accessing wssid and the guid of managed meta data using silverlight

I am making a silverlight UI to allow users to enter information into a list. I want give the users a choice of metadata to enter into the list, but in order to enter the metadata into the list, I ...
5
votes
6answers
23k 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 ...
0
votes
1answer
5k views

Internal Server Error (500) using Managed Client Object Model

I'm attempting my first foray into the Client Object Model. In the following code, using (ClientContext context = new ClientContext(url)) // url works w- SPSite { Web web = context.Web; ...
2
votes
2answers
5k views

Delete all list items with Client Object model

Is there any more efficient way of deleting al list items than getting all items and then deleting them one by one (item.DeleteObject())?
0
votes
1answer
559 views

Albums and images from Photo Gallery with Client Object Model

I have a photo gallery library. I want to get all albums and their images. Now I get all albums (root level items) with something like this: ClientContext ctx = new ClientContext(_url); _mylib = ...
3
votes
1answer
414 views

Time conversion via ClientContext

In native SP list I have item with datetime field which shows 24.1.2010. 00:00:00. When I try get it with ClientContext, I got that item field with the time 23.1.2010. 23:00:00. I understand that ...
3
votes
1answer
1k views

People Picker control for Silverlight, or alternatives?

This is probably a longshot, but does anyone know of a way to resolve a name entered in a Silverlight textbox to a SharePoint User object in Silverlight, using the client object model? Ideally, I'd ...
2
votes
1answer
3k views

ClientContext + camlQuery.ViewXml

I use SP Client and want to return ListItemCollection which will be filled with items from specific view which I choose. I get ViewQuery string by sending view index in viewcollection. Problem is in ...