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

learn more… | top users | synonyms (1)

4
votes
2answers
2k views

SharePoint 2013 Call the REST API from SharePoint hosted app

I've successfully deployed a SharePoint hosted app to office 365 and my local on premise installation. All the app aims to do is call the REST API for the user profile manager to get the profile ...
4
votes
2answers
2k views

Attach a Javascript function to an OOTB ribbon button

I want to attach a custom javascript function to the out of the box "Download a copy" ribbon button. This is to provide analytics for file downloads done through the ribbon button. I tried this ...
4
votes
3answers
8k views

Cannot get field value of list item through JavaScript

I try to get the value of a list item (that is currently selected). I know that I must load it into the context but even with loading the field explicitly I get the following message. Microsoft ...
4
votes
2answers
5k 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 ...
4
votes
3answers
104 views

Is there a way to get Folder object from ListItem one?

This is my first post, so I'd like to say hello to everyone. I'm trying to get Folder object by its path in SharePoint 2010 client application using Client Side Object Model (.Net 4.0). I need to ...
4
votes
1answer
849 views

Check if user is in a specified group

I would like to check with JavaScript if the current logged user is in a specified and specific group (for example called "Admins Group"). How can I do? Thanks
4
votes
2answers
7k 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() { ...
4
votes
2answers
413 views

Can you call SPSite on a different machine to SharePoint setup?

I'm trying to call SharePoint from within a standard .NET class library. This will probably be hosted on a different server to SharePoint. I just need to return an item from a list, and wondered if I ...
4
votes
5answers
13k 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 ...
4
votes
2answers
1k views

SP2010 REST API from Javascript: how to set multiple fields to filter on in the URL

weird but i can't figure this out or find a solution anywhere.... I want to filter on two values on a GET in REST URL from javascript. So since this is from ECMA I am just using filtering in the ...
4
votes
1answer
2k views

CSOM Get ListItem of Folder

In an application I'm working on, I'm interacting with SharePoint (2010) via the .NET Client-Side Object Model, and am trying to account for a large number of possible configurations of document ...
4
votes
1answer
5k 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 ...
4
votes
1answer
2k 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...
4
votes
2answers
678 views

ScriptResx.ashx Not Working

I'm trying to use ScriptResx.ashx in an Application Page I'm building (just to test out the functionality) and every time I try to grab a resource from what should be a JavaScript object, SharePoint ...
4
votes
1answer
490 views

Error using javascript to retrieve a SharePoint list's items

I am trying to use this method to query items of a column of a list in my SP site via javascript (the reason I am doing this is to display that info on the page by modifying the html tags in the DOM), ...
4
votes
1answer
693 views

Working With Content Approval / Moderation In CSOM

The SharePoint Object Model provides a property of an SPListItem called SPListItem.ModerationInformation.Status to allow you to determine the current content approval / moderation status if a document ...
4
votes
2answers
2k views

Managed Metadata and the client OM

Is it possible to return the values of a Managed Metadata field assigned to a document using strictly the client object model? Note that I want to return ALL the possible values and allow the user ...
4
votes
2answers
3k views

Changing the SP.UI.Notify notification color

Does anybody know how to change the color of the notification popup displayed by the SharePoint 2010 client object model for Javascript? The following always gives me a green popup: ...
4
votes
2answers
1k views

Datetime update is one day off

I'm updating a list with a date field (just the date) using the ECMASCRIPT object model but when the date is inserted is one day off from the introduced date, It's literally making me pull my hair off ...
4
votes
2answers
2k views

How to read a column type SPUser, DateTime, Currency with EcmaScript?

I have a list in SharePoint 2010 with some columns. All are default types. So I have "Single line of text" "Multiple line of text" "Date and Time" "Choice" "Number" "Currency" "Person or Group" ...
4
votes
2answers
222 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 ...
4
votes
4answers
7k 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, ...
4
votes
2answers
334 views

Dialog Framework References

One of the new features in SP 2010 is the dialog framework, so that the user is presented with a uniform UI. What are the best references or tutorials you've seen about this feature? So far, this is ...
4
votes
1answer
64 views

How can I read Secure Store Credentials using the Client Object Model?

I got an high trusted provider hosted application that use the App Only Policy. If I try to use server object model, sharepoint returns a context error. Is it possible to use the client object model ...
4
votes
2answers
3k 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 ...
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(); ...
4
votes
1answer
94 views

What would cause CSOM.GetSubWebsForCurrentUser to return Access Denied

When using the CSOM Microsoft.SharePoint.Client.Web.GetSubWebsForCurrentUser returns a 'security trimmed' collection of all sub webs that the current user has access to. e.g. string currentWeb = ...
4
votes
2answers
307 views

Programatically setting Site Collections Administrators in SharePoint 2010 using Client Object Model

I am writing a program where I want to be able to add/remove user/groups as administrator for a given Site Collection. I am using Client Object Model API for SharePoint 2010. I havent been able to ...
4
votes
1answer
685 views

Updating “Editor” or “Modified By” without changing timestamp

We changed domains and I need to updated the User fields in all lists and libraries to reflect the new domain accounts. (I know that stsadm.exe -o migrateuser will mostly handle this but since it ...
4
votes
2answers
170 views

Is it possible to Fire event when Content type added in Shared Documents in sharepoint 2010?

How to fire event when any content type added in shared document library ? How to handle this event ?
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 ...
4
votes
1answer
105 views

Can i use sharepoint 2013 client object model for SP 2010

I am working on a product. Our product is built on top of .NET framework 4.5. We use Sharepoint client object model (v14.0.0.0) for communicating with Sharepoint (both SP 2010 and SP 2013). This works ...
4
votes
3answers
791 views

Commit modal dialog and then display notification

I have a modal dialog that I commit by calling window.frameElement.commitPopup(), and this is great because it refreshes the parent window. However I would also like to display a notification on the ...
4
votes
1answer
1k views

Get TaxonomySession TermStore TermSet Term from Sharepoint 2010 Server using Microsoft.Sharepoint.Client.Taxonomy.dll

I'm coding a c++/c# client-application to communicate with a Sharepoint 2010 site which uses Taxonomy I have downloaded and installed Microsoft.Sharepoint.Client.Taxonomy.dll from: ...
4
votes
1answer
703 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. ...
4
votes
1answer
94 views

TaxonomyClientService GetTermSets - Error The maximum string content length quota (65535) has been exceeded while reading XML data

I'm using the TaxonomyClientService to retrieve the TermSets using the GetTermSets call, the code works fine except one of the result is getting big and I'm receiving this error The maximum string ...
3
votes
3answers
3k views

How to Use ECMA CSOM to Set a Field of Type SPFieldUserValue

I have a JavaScript array containing the string representation of some usernames (domain\username format). Using the JavaScript CSOM, what is the best way to create a new item and add those usernames ...
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
3
votes
3answers
6k views

Get User via JavaScript Client Object Model

Is there a way to get user information via the JavaScript Client OM? Something similar to the clientContext.Web.EnsureUser(userName) method. I am aware that there is the SPService JQuery library, but ...
3
votes
1answer
144 views

JavaScript CSOM. Is It Possible to Change Language for the SP.ClientContext?

I want to find a way to force CSOM to always return values in en-us (1033 locale). For instance, when I'm trying to get ContentType Name using ContentType.get_name() I end up getting different results ...
3
votes
2answers
558 views

SP JSOM: is there any way to get the group by name instead of getById(10)

is there a way I can use the below with something like getByName(thisGroup), instead of getById(10) in SP 2010 jsom: function setSomeUsers(dataObj, projGroup) { var clientContext = new ...
3
votes
3answers
1k views

Query SP2013 Managed metadata term store

I was wondering if it is possible to query the Term Store via the REST API or Javascript Client Object Model in SP2013. I can't quite seem to work out the naming scheme for the REST API to discover ...
3
votes
2answers
6k views

SPService GetListItems with CAML : can't get example to work

enter code hereI am using an example I found on codeplex of SPServices with CamlQuery to try to get list item values with where clause on the ID. For whatever reason this doesn't seem to work for me; ...
3
votes
3answers
7k 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 ...
3
votes
2answers
119 views

Sharepoint unit testing using fakes framework

I have an application which uploads a file to SharePoint via client object model. Now I need to write unit test cases for this application. The problem is, I how do I write test cases for the ...
3
votes
2answers
194 views

View custom field property value using JavaScript

I'm using SharePoint 2010. Need to retrieve the Custom field property values using a JavaScript. [Trying to do this during item click in the SharePoint list item view. I call the JavaScript on the ...
3
votes
1answer
944 views

access a list in a subsite with Javascript

How can i access a list in a subsite? function Read () { var caml = "<View><ViewFields><FieldRef Name='Title'/><FieldRef ...
3
votes
2answers
404 views

calling click event on dynamic controls

What I have is fairly standard code for using JavaScript with SharePoint 2013. Inside the sharePointReady function, I have a few dynamic controls that are added to the page. The problem is that when ...
3
votes
1answer
1k views

JavaScript OnLoad and SharePoint does not work

I have tried this <script type="text/javascript"> function myfunc() { ExecuteOrDelayUntilScriptLoaded(GetSuppliers, "Directory.js"); }; ...
3
votes
1answer
4k views

How to programmatically retrieve item version history from client?

Using server-side code I can access List Item version history using SPListItem.Versions. Is there a way to programmatically access the same information from the client? I am happy to use either the ...