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

learn more… | top users | synonyms (1)

2
votes
2answers
9k 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 ...
0
votes
0answers
19 views

How are list item Likes stored - how do I access individual Likes via REST API?

I need to be able to see who Liked a certain list item on the client side, via javascript - what is the best way to achieve that?
0
votes
0answers
98 views

Client Object Model equivalent of SPWeb.Author in SharePoint 2010

I am trying to access the equivalent to SPWeb.Author in a C# console application that is using the Client Object Model. I've spend a few hours looking into this so far without success. Does anyone ...
0
votes
1answer
73 views

Retrieve notifications with JavaScript

I want to incorporate social feed into my SharePoint webpart. I followed this tutorial: Code example: Retrieve social feeds by using the SharePoint 2013 JavaScript object model. Even if I used ...
1
vote
3answers
314 views

SP ECMA/JS get_siteUsers() not working? trying to get user with getByLoginName()

I am trying to get specific users with this line using ECMA but I keep getting error: this.oUser = cxt.get_web().get_siteUsers().getByLoginName('dev\\joe'); I keep getting property or method ...
3
votes
2answers
569 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 ...
1
vote
0answers
168 views

SP2010 JSOM: error when trying to get all users of specific group using javascript

having trouble getting users return from specified group using javascript per this on MSDN var siteUrl = '/sites/MySiteCollection '; function retrieveAllUsersInGroup() { var clientContext = new ...
0
votes
1answer
187 views

SP2010 JSOM: possible to automate breaking inheritance of item, and controlling role assignment using javascript

i am working on a custom system I am building into a site that allows various reps, of various departments to enter project information and many different aspects of related data (children) into the ...
0
votes
1answer
79 views

ecmascript/javascript to check current status of timer job

I want to show sharepoint notification when user opens a list form using oob. I am basically doing some sync with external list and sharepoint using timer job. For this i want to check if a specific ...
1
vote
2answers
382 views

Retrieving the Name of a Document Saved in a Document Library Using the Client Object Model

foreach (SPListItem item in listitems) { String value = item.File.Name; } The above sever side code shows how to retrieve the name of a document which is saved in a SharePoint document ...
1
vote
2answers
345 views

Access denied, from an app, when getting List items from a different web applcation

I have create a SharePoint Hosted App and installed on a Site which is located on WebApplication1. This app tries to get list items from a list in a site which is located on Webapplication2. I have ...
1
vote
0answers
125 views

Update value of column in Form Library using CSOM

I want to update the value of a promoted field from infopath form by csom code. I have written the following code but it does not seem to work. Please guide to know what is incorrect. function ...
0
votes
0answers
94 views

Copy list item and add it to the same list by copying their ID using ecma script

I need to Copy a list item which is selected and add it to the same list using ecma script..no workflow and designer is allowed(only client object model). I tried to copy the list items but i havent ...
0
votes
0answers
66 views

Access the infopath form data using client side object model

I am using client side object model in SP2013. Now I am stuck in a scenario where I need to access infopath form data. I have a lot R & D but not got anything yet.
0
votes
1answer
276 views

Get ListItem ContentType and Metadata values at a specific version

I'm trying to figure out a way, using the Sharepoint Client Object Model, to get the content type and the metadata values of a listItem at a specific version. I can get the different versions using ...
2
votes
0answers
170 views

ssl certificate error when using Client object model

I wrote an app that gets information from some Sharepoint 2010 lists and displays it to the user. It works fine on my development machine.But when I copied the exe to another desktop machine i got the ...
0
votes
1answer
668 views

Why, on occasion, does executeQueryAsync() fail to execute success OR failure method?

My intent is to dynamically create a grouping of EditControlBlock (List Item Menu) custom actions for two different list view pages. Upon loading the Active page, all custom actions are destroyed, ...
0
votes
1answer
5k views

How to reterive list item values using CAML query?

I have one Date and time column and text colum. I need to retrieve list item value based on this both column using CAML query.. For ex: Columname---> Date value for date would be-6/1/2013 and ...
0
votes
1answer
350 views

Exception when trying to execute query on large library from client object model

I have a document library with ~50,000 documents in it. I have a Client Object Model query which retrieves the ListItems in the document library. This query previously worked when the document library ...
0
votes
1answer
103 views

SP2010: possible to override styling of the upload aspx dialog from calling parent page

This may be a silly question, but I am wondering if it's possible to override styles for the upload.aspx dialog to customize the look...not from the upload pages content but form the calling 'parent' ...
3
votes
1answer
179 views

Bug? 2010 Document Sets via Client Model shown as folder

I got a frustrating problem: When I create a document set via Client Object Model, the document set is created as intended as far as it concerns the appearance outside the treeview. It's shown as ...
1
vote
1answer
554 views

SP2010 JSOM: updating with CAML where clause

So I learned and have used the following to update a list item by ID using Javascript Client Object Model: function updateItem(passedID) { var ctx = new SP.ClientContext.get_current(); var myList = ...
0
votes
1answer
176 views

How to get the list item column values based on the html drop down and display in the alert box using Javascript?

I have a html dropdown list(team name) which contains three values A,B,C I have a sharepoint 2010 List A which contains Team name and Email. List A Teamname Email A A@test.com B ...
0
votes
2answers
340 views

How do I delete potentially many items from more than one list using JavaScript?

I'm trying to use a script to remove multiple list items from multiple lists. I'm using Javascript because I don't have access to Visual Studio. The idea is there's a Parent List item in a ...
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 ...
3
votes
1answer
317 views

How can i add multiple items to a lookup

I have a CSOM console app that uploads files to a library, then it creates a lookup field in another list and also adds lookups to the files in my library. The following code adds a single item in ...
0
votes
1answer
92 views

Possible to upload to a style library remotely using client context?

As title says. I have a win forms app that connects to a remote SharePoint instance using the client context. How can I now, programmatically, upload a file to this style library and what permissions ...
1
vote
0answers
193 views

How to get the distinct values from sharepoint list using GetListItem and bind to dropdown?

I am Passing the XML for getting List item and binding to dropdown. Here i have shown the code.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...
0
votes
1answer
125 views

Anonymous Users and managed navigation

I have a custom javascript that builds an extra navigation menu from a Managed Navigation termset. Currently this is using JSOM and is great - when a user is logged in. The problem is anonymous ...
2
votes
1answer
2k views

Get List Items using ECMAscript CAML query

Hi can anyone show me how can I retieve list items based on 2 fields using ECMAscript CAML? I have a list where I have uid as number and city as text. I want to retrieve all items where uid = 100 and ...
2
votes
0answers
123 views

Dynamically Setting a List View on a WebPart Page

I have been unable to load a page showing a dynamicaly selected View. I can not just display the List itself (Although this would allow me to specify the View in the URL) because I need to modify ...
0
votes
1answer
190 views

Any way to access organisational data?

I would like to access the data that feeds the 'organisation chart/structure' web part in SP 13 online. Preferably JavaScript. I can't find any reference to any part of the api that would allow me to ...
0
votes
1answer
21 views

COM ListItem not updating

ClientContext cl = new Microsoft.SharePoint.Client.ClientContext("http://" + "mysharepoint" + "/" + SubWeb); System.Net.NetworkCredential cred = new System.Net.NetworkCredential("myuser", "mypass", ...
2
votes
1answer
212 views

Is it Possible to create Client Web Part enum property dynamically?

I am creating an SharePoint Hosted App using CSOM technology. I want to set the ClientWebPart Property dynamically. I want to add enum property Dynamically. App will bring all the list name from my ...
0
votes
1answer
235 views

502 DNS lookup failed error when using SharePoint 2013 CSOM

I am facing an issue while using CSOM in SharePoint 2013. I have configured an alternate access mapping for our site to run on http://mycustomdoamin.net/ The site is running fine and I am able to see ...
0
votes
1answer
51 views

Reference for ECMAJavascript Library gets?

Is there a method reference for all the gets/sets in the. ECMAScript JavaScript library for sharepoint 2010. I know the obvious answer is MSDN but I have trouble finding anything there. For example I ...
0
votes
2answers
62 views

JQuery on SharePoint 2010

What are the business case scenario when JQuery controls are used in CSOM programming in SharePoint 2010? I mean what are business case scenario when JQuery frequently used in SharePoint 2010? Which ...
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 ...
0
votes
0answers
354 views

ecmascript check if item exists in lists

I have to check whether _spuserid exists in 10 lists of same structure and columns. var arrayOfLists=["list1","list2","list3",.......,"list10"]; for(var i=0;i<arrayOfLists.length;i++) { var ...
1
vote
1answer
104 views

Get list of installed apps using Client Object Model

I have been trying hard to find any example, resource which explains how to get a list of installed apps in SharePoint 2013 environment using Client Object Model. So far I have found nothing. Could ...
1
vote
1answer
161 views

ClientContext.Load on data that is already loaded

I need clarification how does ClientContext.ExecuteQuery method works in client context. For example if I use ClientContext.Load to load the data that is already initialized - will it make an request ...
1
vote
2answers
399 views

SaveBinaryDirect Throws Unauthorized When the Client Object Model Works fine

I have decided to use the SaveBinaryDirect Method to upload documents to the sharepoint site due to not having the request/file size limitations that the client object model has. The application does ...
5
votes
3answers
706 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 ...
1
vote
2answers
114 views

How to write a caml query that filters by .pdf or folders?

How can I write a CAML query (for javascript ecma) that filters by only pdf documents or folders in sharepoint 2010? (this is for document libraries) Thanks.
0
votes
1answer
70 views

Creating directory structure from custom ribbon action

Environment: 2013, VS2012 I'm trying to develop a custom ribbon button for a document library that creates a folder (ie: a new project) and populates it with a hierarchy of sub-folders. I have some ...
1
vote
0answers
85 views

how to update Document in doc set

I've been trying to update the file name of a document inside of a doc set. I continually get either a "Invalid data has been used to update the list item. The field you are trying to update may be ...
3
votes
1answer
1k views

SP2010 JSOM Client Object Model: How to get all documents in libraries including all folders recursively

I have seen a lot of examples and questions about this out there but nothing I have found has helped me accomplish this. I need to be able to grab all the names of the documents within a given ...
0
votes
2answers
971 views

Why does JSLink code associated with a site column fail to render on first load of document library view, but renders successfully on page refresh?

Bit stumped on this one, wonder if anyone can help? I've created some JavaScript which is stored in the Style Library and referenced by the JSLink property of a site column. When I navigate to a ...
2
votes
2answers
230 views

SP2010: Get all library names within a site using javascript client object model?

How do I get the names of all libraries within a given site using jquery/javascript? the only way i know of is using getByTitle('listtitle'), but I would like all names of libraries (hopefully there ...
0
votes
1answer
82 views

Dependencies in the jscript file

Lets say, I have custom-dialog.js that depends on custom-notifier.js and this one depends on sp.js. What's the best practises to write dependencies inside mine custom .js files?