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

learn more… | top users | synonyms

0
votes
0answers
28 views

Difference between GetFileByServerRelativeUrl and GetFolderBy… when moving file/folder

I've been trying to create a method that would move a file or a folder. To get the file that I want to move, I am using Web.GetFileByServerRelativeUrl and then on the returned file I invoke MoveTo ...
2
votes
1answer
64 views

Javascript object model says load succeeded, but object is empty?

I've got a pretty weird issue going on on a clients SharePoint 2013 environment. We're using some JSOM javascript code to retrieve details from a web. Here is a snippet of the code: function ...
1
vote
1answer
717 views

“The collection has not been initialized” when doing ListItemCollection.getEnumerator()

I have been having a problem with Javascript and Sharepoint 2013. I have a number of custom list rows that contain date and time values. I want to determine if there are any overlapping date spans. ...
11
votes
2answers
28k 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() { ...
0
votes
0answers
44 views

How I can use SCOM to create a dashboard for SharePoint health monitoring?

I want to create a dashboard with the help of SCOM 2012 to monitor SharePoint multiple farm health. Can someone give me some ideas or suggestions or any reference how I can start and proceed further.
6
votes
3answers
4k views

How to create SharePoint list with custom template using Managed Client Object Model?

Creating lists in SharePoint using Managed Client Object Model is rather easy task. Here's how to create a list with SharePoint's custom list template: ListCreationInformation lci; List list; lci = ...
5
votes
4answers
9k views

PowerShell and the client object model: “The collection has not been initialized”

I'm trying to grant a user permission to a SharePoint site using PowerShell and the client object model. The code I'm using is as follows: # Setup context $context=New-Object ...
3
votes
2answers
3k 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 ...
2
votes
2answers
286 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
38 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 ...
5
votes
2answers
9k 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
4answers
11k 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
224 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
10 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 ...
4
votes
2answers
112 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 ...
1
vote
2answers
2k 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
91 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
145 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
548 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
30 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 ...
3
votes
0answers
105 views
1
vote
1answer
387 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
316 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
0answers
68 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
402 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
1k 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 ...
4
votes
1answer
892 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
154 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?
3
votes
2answers
155 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
83 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
20k 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
956 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
142 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 ...
1
vote
1answer
586 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
79 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
397 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
27 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
1k 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
14 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
13k 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
830 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
307 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.
1
vote
2answers
1k 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
68 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? ...
3
votes
1answer
515 views

How to create a list template by using CSOM?

For creating a list template programmatically by using server object, I'm using the SaveAsTemplate() function. SPSecurity.RunWithElevatedPrivileges(delegate { using (SPSite oSPsite = new ...
0
votes
0answers
30 views

Sharepoint 2010 Client Object Model

I have been building an application in SharePoint 2010 using InfoPath and SharePoint Designer. The InfoPath Forms submit to SharePoint Lists. Everything has been going well, but now I need to ...