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

learn more… | top users | synonyms (1)

2
votes
2answers
341 views

Dispose in Client Object Model

Should objects be disposed when using the client object model? If so, which ones? There seems to be plenty of information on this for server side, but nothing from Microsoft specifically about ...
30
votes
9answers
13k 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 ...
10
votes
3answers
3k views

Grab a specific property bag using ECMA script

I am trying to grab a key/value pair from a specific property bag but can't find any documentation or example code on how to grab a property bag. Currently I can only seem to grab allProperties. Here ...
5
votes
1answer
443 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: ...
9
votes
1answer
2k views

Client Object Model Equivalent of SPSiteDataQuery?

I'm looking for an equivalent to the SPSiteDataQuery functionality in the Client Object Model (COM). The CamlQuery can be used with an instance of List to execute SPQuery level of aggregation, but is ...
0
votes
1answer
1k views

Add an existing WebPart Using the Sharepoint client object Model [duplicate]

My knowledge of the Client Object model is fairly limited, although I have been able to remove and move existing web-parts on a particular page. But I'm now struggling to find and then add a custom ...
12
votes
3answers
2k 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 ...
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 ...
34
votes
6answers
25k 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 ...
12
votes
2answers
2k views

Cannot add custom web part to page using the JS OM

I'm trying to add a custom web part (that is one I have written myself) using the new Javascipt OM available with SharePoint 2010. My solution is also running within the Sandbox. I have it working ...
8
votes
2answers
6k views

Pass parameters in ExecuteOrDelayuntilScriptLoaded in Javascript client Object model

I have written a javascript client-object model code and I am calling it through the below line code from content editor webpart: ExecuteOrDelayUntilScriptLoaded(getWebSiteData(sys), "sp.js");// ...
7
votes
1answer
3k 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?
6
votes
3answers
8k views

Javascript to display sharepoint list items on page load

With Client Object Model API and a bit of javascript, I want to retrieve the items of a sharepoint list and display them into the web page, when the web page loads. I've successfully implemented ...
2
votes
1answer
4k views

jQuery & SP2010 : Upload document to library using jQuery?

I built a custom form that saves the data to multiple lists with on click; it works pretty well for its intended use (keeping the data related). Thing is I am totally new at jQuery and SPServices, but ...
6
votes
4answers
1k views

How to access a Web application/Farm level property bag via jQuery/Javascript/ClientContext

It it possible to access the Web application/Farm level property bag using jQuery/Javscript/ClientContext? If not, then what are the possible alternatives to access Web Application Farm level property ...
5
votes
1answer
1k views

How to Upload File to Document Library using JavaScript Client Object Model?

I want to Upload File to a Document Library using JavaScript in SharePoint 2010. I found that you can copy file from One Document Library to Another but you can't upload File using JavaScript on this ...
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 ...
5
votes
6answers
9k 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.
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
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
1answer
6k 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 ...
3
votes
3answers
2k 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 ...
2
votes
2answers
8k views

Get current user in Client Object Model with javascript?

var ctx = new SP.ClientContext.get_current(); var web = ctx.get_web(); ctx.load(web); var user = web.get_currentUser(); alert(user); I used above code to get the current user using JavaScript, but I ...
1
vote
1answer
6k 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(); ...
1
vote
0answers
466 views

Get group membership of current users using ECMAScript [duplicate]

Possible Duplicate: How do I determine a user's SharePoint group membership using the client object model? How can I use the client object model to get a list of all (SP) groups the ...
0
votes
1answer
620 views

Registering pageComponent using ClientObjectModel

is there any ways to register PageComponent using client object model? I want to add custom action on the edit form with dynamically populating FlyoutAnchor. But when page has been loaded i recieve ...
7
votes
3answers
9k 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 ...
5
votes
3answers
6k views

How to access list in SharePoint Hosted App?

I want to create an Sharepoint hosted app but how to access list in these App ??
5
votes
2answers
1k views

How to retrieve distinct values with JavaScript Client Object Model

How can you get distinct values from a SharePoint List column using JavaScript without a huge performance hit? A simple example would be appreciated :)
6
votes
1answer
2k views

Context Menus - Send To not working in IE9

I have a document center with a custom master page. The page is designed with IE9/HTML5/CSS3 in mind. In my other question, I worked out how to fix the IM Presence icons by fixing some core ...
5
votes
3answers
701 views

Create a new wiki page using the 2013 Client Library

I'm using the SharePoint 2013 Client Library and am trying to generate new wiki articles. I'm able to connect, retrieve the web, find the list, but I can't add items. I feel like I need to be using ...
5
votes
4answers
5k 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 ...
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" ...
2
votes
4answers
10k views

Get Items Under Folder CAML

I am trying to retrive all items that are under a certin folder, in a document library. this is what i have so far List DocumentsList = clientContext.Web.Lists.GetByTitle(list); CamlQuery camlQuery ...
1
vote
2answers
482 views

Error while pdating Master Page through JavaScript Client Object Model using SP 2013 App

I have created a Site Collection in SharePoint 2013 online. In this site I am trying to update Master Page through JavaScript Client Object Model. My JQuery scripts are able to change the Site Master ...
6
votes
1answer
2k views

How to 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 ...
5
votes
2answers
3k views

moveTo and moving documents from one library to another

I have followed and successfully implemented the excellent article: SharePoint 2010 ECMAscript – Copy\Move files to another document library – Part 2 located at: ...
5
votes
4answers
5k views

Get current web url in a SPRibbon Custom Action Command

I've a SPRibbon custom action with the purpose of open an custom app page in a modal dialog, but I'm getting troubles for getting the current web URL, as well, set a reference for a .js with the right ...
5
votes
1answer
2k 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.
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
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 ...
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
2k views

SP2010 Javascript REST API: updating list item using MERGE and POST

I am trying to use REST API approach in javascript to update a sharepoint list item where I have an id. So I use GET and POST to create records, but per MSDN article it looks like the way to do this ...
3
votes
4answers
7k views

SP.UI.ModalDialog.RefreshPage from the dialog itself?

I have customized the display form on one of my list. On a webpart page, I have drop a view to this list. When I click on the title of my item, the custom disp form is shown as expected in a modal ...
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
2answers
1k views

SharePoint Client Object Model Assembly Distribution

I would like to know if it is illegal (against MS licensing agreement) to: Copy the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies from a SPF 2010 server to TFS ...
1
vote
3answers
1k views

jquery and javascript : can i get the last ID from document library?

Is there a way to get the last ID from a Document Library with javascript/jquery?
1
vote
2answers
791 views

CSOM Query on Hidden User Information List returning nothing

I'm trying to retrieve a user's profile picture from the hidden User Information List within Silverlight. I can't use the UserProfileService.asmx because I don't have the login name nor the GUID of ...
0
votes
1answer
1k views

Properties when uploading Files using REST in SP 2013

After a lot of research I finally got uploads via REST working in SharePoint 2013. But I would like to provide additional properties to the Add Function like Title. This code works so far but the only ...
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() { ...