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

learn more… | top users | synonyms

3
votes
2answers
2k views

Exception calling “ExecuteQuery” with “0” argument(s): "The remote server returned an error: (400) Bad Request. CSOM SP13

I'm trying to add a page to my search centre in sharepoint 2013. Trying out cSOM too. Here is my code, I am getting a bug Exception calling "ExecuteQuery" with "0" argument(s): "The remote server ...
0
votes
3answers
585 views

Get all sharepoint sites in a site collection to which user has access using Javascript client object model

I want to display all sites in a site collection using JSOM to which user has access to. In other words I only need to find collection of sites to which user has access in a site collection. I am able ...
2
votes
2answers
285 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 Web Part is the way to go to ...
1
vote
0answers
24 views

Save a SharePoint 2013 workflow as template using code behind

We have around 100 SharePoint 2013 workflows in our Farm. We need to save these workflows. It is tedious to manually open Sites in Designer and go to each workflow and store it as a template. Is there ...
2
votes
1answer
2k views

set multiselect lookup column using jquery

I have a Multi select Look up column which as you all know is a control with two list boxes and "Add or Remove" Buttons. The user populates the right-hand side of the control with some values by ...
5
votes
2answers
8k views

Check Out, Update, then Check In a File in SharePoint Client Object Model

I would like to programatically update a SharePoint file by checkout/checkin. I have written code that looks like it should do what I want it to do: static void ...
3
votes
2answers
712 views

SP O365 upload big file via CSOM

Hi I try to upload large files (900 MB) to SP Online (actually the OneDrive Business) but seems to follow SP style. Tried this via CSOM and powershell 70 MB are fine but when I try 900 MB a timeout ...
3
votes
4answers
10k 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
2answers
61 views

Fetch value of people picker column using javascript - SP2010

I'm using a function to grab the id from the url of the record and fetching numerous field values successfully. It seems to work fine for all fields except for people pickers. When I display the ...
3
votes
1answer
1k views

How to open file in adobe reader using command line without checkout from Javascript?

I am working on print functionality. I am printing the PDF files (uploaded in SharePoint Library) using Adobe Reader command line from javascript. I am using ActiveX object to call the cmd. refer ...
0
votes
0answers
8 views

Is there a way to get the IDs back in response of newly created documents when uploading multiple silverlight control

I need to provide the ability to allow multiple documents at once while allow for a couple of parameters as meta. So is there a response body object that comes back from the server when using the OOB ...
2
votes
1answer
1k views

Retrieve Multi-line Text Field with Append Changes in CSOM (Javascript)

I have been looking for an answer to this question all morning and i cannot find anything to point me in the right direction. We have several customizations to a SharePoint page which displays list ...
4
votes
2answers
71 views

Get\Set values from SharePoint 2013 custom fields

How to Get\Set values from ListItem in SharePoint 2013 custom fields using CSOM and C#?
4
votes
2answers
2k views

How to get a client context for App in provider-hosted Apps?

I use a provider hosted Apps, so need to work with an App Web and Lists. Could anybody provide a code snippet to get ClientContext() of the App? Can I do something like this? Uri appWeb = new ...
0
votes
1answer
695 views

SharePoint 2013 External Content type. Populate secondary fields

I am trying to migrate data to a document library that contains a external content type using the SharePoint 2013 client object model. The external content type is pulling from a sql server 2012 ...
1
vote
2answers
1k views

Get project custom fields (Project Server)

I am trying to access, in a project detail page, the project context via Javascript to retrieve the data of the custom fields. But my problem is that, when I try to access all the data it only shows ...
1
vote
1answer
66 views

executeQueryAsync don't behave as synchronously

I am creating different forms where I need same functions, so I created separate js file which I call on my each forms. In below code if alert currentUser from success method then I get the value but ...
2
votes
1answer
125 views

Difference between Publishing site and Team site while loading SP.JS

I would like to know what is the difference when loading SP.JS file in Publishing site and Team Site. SP.SOD.executeFunc('sp.runtime.js', 'SP.ClientContext', function () {}); ...
6
votes
5answers
2k views

Get webpart's Zone Id via CSOM

How to get Web Part Zone Id via CSOM? WebPart has property ZoneIndex but no ZoneId while WebPartDefinition has method MoveWebPartTo(string zoneID, int zoneIndex) but lacks methods to retrieve the ...
5
votes
1answer
503 views

Adding an existing app part using the client object model( finding the xml)

I've recently found this nice thread on adding an existing webpart using the csom: Add an existing WebPart Using the Sharepoint client object Model I've tried the same approach for an app part (so an ...
1
vote
1answer
23 views

Add user to group error - Code

I am getting an error when trying to add a user to group in JavaScript, here is my code below: user = web.ensureUser("domain\\natalie"); membersGroup = web.get_siteGroups().getByName("site ...
2
votes
0answers
85 views
1
vote
1answer
289 views

Get GUID by term name - jsom

I need to pass term name as a parameter and return the GUID of that particular term. As an example if I pass My Term 1 it should return GUID of My Term 1. var termGuid=getTermByName('My Term 1'); ...
0
votes
0answers
234 views

Get Taxonomy Terms, GUIDs, Synonyms (Other Labels) into Array within a SharePoint Page (not App)

I am using the code below to get terms (Later I will push these into an array). This is based on this article: Working with Taxonomy and JavaScript in SharePoint 2013 It is pushing the term names, ...
1
vote
1answer
63 views

Client Object Model RoleDefinitionBindingCollection.Remove not working

I'm using the Client Object Model and trying to remove a specific RoleDefinition from a RoleDefinitionBindingCollection in a RoleAssignment. This is the code I'm using: Web web = ...
1
vote
0answers
39 views

How can we programmatically add a hyperlink and text to a multi-line text field?

I have a SharePoint list which has a multi-line text field. Can we add a hyperlink and simple text along with it, inside that particular field using the client object model? If so can someone help me ...
0
votes
3answers
73 views

Issues with Minimal Download Strategy and _spBodyOnLoadFunctionNames.push

I noticed that on the sites that have MDS activated, functions that I queue up with _spBodyOnLoadFunctionNames.push do not get executed. I can step through my code and I see ...
7
votes
3answers
967 views

SharePoint 2013: Using JSOM, get a list of all sites user has access too

I was looking at the JSOM documentation, but couldn't find a nice way to spin through all site collection and sites to show a user what they have read access to. Is this possible using JSOM and a ...
3
votes
1answer
689 views

GetUserEffectivePermissions returns wrong results

I'm checking the permissions for user on a SharePoint 2013 list: using (var ctx = new ClientContext("http://comtoso.com")) { var list = ctx.Web.Lists.GetByTitle("TestList"); ...
1
vote
2answers
87 views

Creating custom content organizer rule using Client Object Model in Sharepoint 2013

Can we create custom content organizer rules using Client Object Model in SharePoint 2013? If no, then what way of doing it should be followed?
1
vote
0answers
36 views

Unable to get the DisplayName of feature using CSOM

I am trying to get the names of all the features available at site collection using CSOM. Below code works fine to get list of all the Features but i am unable to get the DisplayName property. ...
3
votes
2answers
51 views

Object Doesn't support property or method '$1X'

I am using JSOM in Nintex Forms 2013. My script includes are /_layouts/15/sp.runtime.debug.js /_layouts/15/sp.debug.js /_layouts/1033/init.js /_layouts/MicrosoftAjax.js /_layouts/sp.core.js ...
0
votes
1answer
47 views

Client Object Model Authentication using SharePoint App permission

I'm developing a SharePoint App that is provider-hosted. Could I access to a site collection using App permission (this means using ProductID and IssuerID and etc) without StandardToken? Usually the ...
4
votes
3answers
18k views

Retrieve list item using CSOM on SharePoint online isn't working

I've been stuck on this problem for couple days, I develop app model on SharePoint online using provider hosted model. From clientwebpart, i want to access sharepoint list item. I can access list ...
3
votes
2answers
678 views

Get Parent term set id using JSOM

I want to get parent term set id in SharePoint online using term_parent.get_id(); in below code.I am getting all terms but unable to get parent term id.It is giving me error as Uncaught Error: ...
1
vote
2answers
84 views

JSOM: Fastest way to get count of list items in a view

My current JavaScript implementation is based on answer in How to get all items in a View using Client Object Model (JavaScript). Is there a way to avoid loading the view first? Also, I am not ...
2
votes
5answers
19k views

get the login name of the current user using javascript

var context = new SP.ClientContext.get_current(); this.website = context.get_web(); this.currentUser = website.get_currentUser(); alert(currentUser); i tried this code, but i got an ...
1
vote
1answer
103 views

Uncaught ReferenceError: SP is not defined

I am trying to implement to Sharepoint simple function from MSDN which I've placed in aspx file but I got this error in js web browser console: Uncaught ReferenceError: SP is not defined. Any ideas ...
0
votes
1answer
33 views

Save site as template using client object model [duplicate]

I would like to reproduce the "Save site as template" action with the client object model. Can someone give me a hint how to do this?
1
vote
1answer
115 views

Move a file across site collections with version history

I have the need to move a document using Client Object Model across site collections in SharePoint Online while retaining its metadata and version history. The sp.movecopyutil methods allows us to ...
0
votes
1answer
20 views

The property or field 'Id' has not been initialized

I want to get user ID from client context by looping through groups. I wrote following code. When I run this code I get an exception "The property or field 'Id' has not been initialized. It has ...
1
vote
1answer
1k views

Not able to fetch Term store and related terms using client object model

I want to fetch termstore, Termsets and related terms.However, Iam not even able to fetch the termstore. Below is the error message. TypeError: termStores is undefined termStoresEnum = ...
0
votes
3answers
820 views

How to get termstore GUID by giving its name

I've a term-set called My Term Set, I need to get the Unique Identifier by passing its name. How can i do that? This is the code i have tried so far but it gives undefined Please help me thanks a ...
0
votes
0answers
12 views

Retrieve all users can be added to a web on SharePoint Online

Is there any way to retrieve all users that I can add to a site on SharePoint Online? I want to add some users to a site from a web app that is out of SharePoint. The app has app-only permission(Full ...
3
votes
1answer
12k views

How to retrieve all items from a list (with custom fields) by javascript object model

I need to get all my custom fields from my list by Javascript Object Model.. The code I wrote down is this: var items; $(document).ready(function () { ...
2
votes
1answer
541 views

How can I get a listing of all sites in my site collection using Client Object Model?

As the Site Collection Administrator, I don't have access to the servers to write server side code to get a listing of all sites in my site collection. I can write sandbox solutions in SP2010 to get a ...
0
votes
1answer
167 views

Disable “Require Use Remote Interfaces permission” using power shell

I want to disable "Require Use Remote Interfaces permission" of web application using power shell script.
8
votes
3answers
2k views

Set request access email address through CSOM

In the server side object model it's possible to set the request access email address through the property SPWeb.RequestAccessEmail (MSDN). Since we are moving our SharePoint tenant to Office365 I'm ...
1
vote
2answers
937 views

how to update properties of item in doc set with client object model

I've been able to create doc sets and upload files to it with the client object model. I am having difficulty updating the properties of the files in the doc sets. Here is what I've tried: public ...
2
votes
1answer
45 views

Can get User Department via JSOM or REST (no UPA)?

The farm has not UPA service deployed and I wouldn't do it. Is it possible to retrieve using JSOM or REST one of the properties that we see in the _layouts/15/userdisp.aspx? page for a specific user? ...