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

learn more… | top users | synonyms

0
votes
3answers
287 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 ...
1
vote
1answer
28 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 ...
4
votes
1answer
84 views

Differing ways to make executeQueryAsync calls (Function.createDelegate)

I want some understanding on two programming patterns I've seen and when to employ them. The question is about callbacks and delegate. In the first code there are two distinct functions, success ...
1
vote
1answer
76 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
131 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 ...
1
vote
2answers
131 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 ...
0
votes
1answer
65 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
450 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 ...
1
vote
1answer
307 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
26 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 ...
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 ...
0
votes
1answer
77 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 ...
2
votes
1answer
61 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? ...
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 ...
0
votes
1answer
174 views

executeQueryAsync synchronously in each loop for sharepoint javascript model

I am performing looping in javascript for sharepoint. I want it to perform synchronously, means only after first data execution is done it should start with second. If first data execution is ...
1
vote
1answer
56 views

Caml query for date range not working in ecma

Not able to get item collection by my CAML in date range, while able to get in simple CAML query. Please any body let me know what is the correct format of passing date string. function ...
1
vote
1answer
332 views

editDocumentWithProgID2 in CSOM

I need to Open/Download Word or PowerPoint Document directly from Provider Hosted SharePoint App. We can perform easily in on-premise using editDocumentWithProgID2 Tried with getting CORE.js, SP.js ...
6
votes
1answer
148 views

How to copy the entire source folder to target folder within same document library using c# and CSOM?

I want to copy the entire source folder to target folder within same document library using c# and CSOM I've folder structure like in Shared documents/Expenses will be the source folder. the target ...
1
vote
1answer
192 views

Assigning Term Store Administrator on SharePoint Online using CSOM

I am trying to setup a SharePoint Online Site Collection 100% programmatically via the CSOM in a .Net application. I have been able to create the Site Collection itself, sub-sites and lists, but I am ...
0
votes
0answers
55 views

Date parsing from JavaScript works for Firefox, not for IE

I am trying to parse a date in my java-script code, which is working fine in Firefox browser but not returning correct results in IE. below is my sample code: var shiftDate=recordArrayItem[i][0]; ...
1
vote
1answer
307 views

How to copy documents from one folder to another in SharePoint document library using client object model?

I want to copy documents from one folder to another within same document library along with metadata (retaining metadata from source) using client object model with Microsoft. SharePoint.Client.dll
0
votes
2answers
1k views

How to check if the file or folder exist in SharePoint document library using client object model?

Is there any way other than looping through the Files to check whether the folder or files exist in document library using clientcontext - client object model.. Can someone confirm me whether the ...
2
votes
1answer
398 views

JSOM How to get User Id

When trying to resolve a user with the ensureUser() call, the object is always returned as undefined even though the user exists as a Domain and SharePoint user. //Calling code. var currentCtx = ...
0
votes
2answers
34 views

How to do a httprequest with some dynamic url clientside, but do not redirect to this url?

I created a custom action with some javascript inside of it. I would like to genereate dynamic some url. Then I would like to do a httprequest to this url. BUT I do not want to redirect to this url, ...
2
votes
0answers
133 views

Activating a Web-scoped Feature using SharePoint 2010 CSOM fails with ArgumentException on featDefScope

I'm trying to activate a Web-scoped feature using the Client Object Model in SharePoint 2010. The code works when activating a feature in SharePoint 2013, but when run against SharePoint 2010, I get ...
3
votes
0answers
46 views

Handling concurrency in SharePoint Client Object Model

I'm currently working on an enterprise portal built completely using provider hosted apps, ECMA CSOM and .NET client object model. We are almost at the end of our development phase and we started ...
1
vote
1answer
281 views

CSOM - Incorrect Usage of Exception Handling Scope

I am trying to use ExceptionHandlingScope in a basic Managed client side crud I am getting the error - Incorrect Usage of Exception Handling Scopes namespace ConsoleApplication1 { class ...
1
vote
1answer
103 views

How to change “Who can view the membership of the group” Group Members to Everyone through csom javascript

I was wondering if it's possible to alter a setting of a group such as Who can view the membership of the group? Setting from Group Members to Everyone through CSOM or through SP's web services. ...
1
vote
2answers
107 views

How to control the order of my javascript logic in my display template?

I have created a custom item display template. In this custom item display template I try to check if the current user has contribute permissions to the item. The item is an sitecollection. If the ...
0
votes
1answer
44 views

Cascading dropdown with long texts(string)

I have a scenario where on selection of service, I am filling services description drop-down, which is working fine. But, since the description is having lengthy texts it looks really ugly. Is there ...
1
vote
2answers
130 views

Can webparts be added using the client side object model?

I have found loads of guides showing how to do this, but none if them show how to do it using the client side model. This should do what i want, but its using the server side model and not the client ...
6
votes
2answers
2k views

Get list item url javascript object model

This is such a simple question I thought that it would have been answered somewhere else (but can't find a clear answer).... How do I get the list item url using the javascript object model? I'm ...
1
vote
0answers
155 views

How Do You Edit Pages Using The Client Side Object Model?

Im using the C# CSOM object for Sharepoint 2013. I want to edit the homepage of a site so i can add some custom content to it. I want to be able to add some custom text and some web parts in the ...
0
votes
1answer
171 views

Is it possible to duplicate a subsite using the C# client side object model

I need to create a large amount of sub sites. Each one will be the exact same to support various products. I have code written already to create a subsite and add the apps to it, but its proving to ...
0
votes
0answers
46 views

Performance Optimization when loading Termsets

I have a problem with retrieving the terms of a termset in my program (which is written in VB). The termset has about 300 terms, and all of them have about 10 to 70 subterms. I wanted to integrate all ...
0
votes
0answers
39 views

How do use JS to Query and Display a Calendar View

I am customizing an intranet site with SharePoint 2013. I created a Calendar App and want to query the view and display it in a customized HTML/XML webapp that will be used with other data/content. ...
0
votes
1answer
659 views

Get sub folder from document library using SharePoint.Client.dll

I need to get the folder named Arshad from SharePoint Document library folder. The path of the sub folder is : http://url/Shared Documents/Arshad I need to access the folder using SharePoint ...
0
votes
1answer
175 views

What is the Best way to use angular with SharePoint

I'm trying to find the Best way to Build a SharePoint site(not an app) with Angular. I've multiple Content Editor webparts where I use the REST/JSOM to load content(Ex: Image Slider, List of Calendar ...
5
votes
1answer
784 views

CSOM: How to get user groups specific to a site and not all the user groups in the site collection?

I am trying to get the list of user groups specific to a site (within a site collection) but the Web.SiteGroups is returning all the user groups at the site collection level, and therefore I am unable ...
0
votes
0answers
76 views

Upload a file in Host web using SharePoint Hosted App

I'm trying to upload a file into /_catalogs/masterpage of the root site using my app. But it seems that I'm unable to access anything outside of my appWeb. uploadFileToHostWebViaCSOM = function ...
0
votes
0answers
149 views

Update SharePoint List when clicking button on InfoPath form

I have an InfoPath 2013 form that pulls information from numerous sources, including several SharePoint lists. There is a button on the form (NOT the Submit button) that does some work behind the ...
0
votes
0answers
123 views

SharePoint User Impersonation through CSOM in SharePoint/Office App

I am trying to create an Office App for Word that will have read access to a List in a SharePoint tenant. The goal is to show only the items on the list that are published and within the user's ...
1
vote
0answers
885 views

clientContext.Credentials = CredentialCache.DefaultNetworkCredentials - in CSOM returns 401 unauthorized thru IIS

I am trying to access sharepoint site using CSOM with Windows Authentication. It works if I run it in visual studio on a server. However, it returns a 401 unauthorized when I run the site thru IIS on ...
0
votes
0answers
116 views

Javascript Conflict on Visual Webpart when adding multiple times with different webpart properties on single page

What I am doing: I am retrieving list items from list using javascript as per visual webpart custom property. I have created a dropdown in webpart editor part from where I am getting site url. As per ...
0
votes
2answers
159 views

SharePoint 2010 Client Object Model code for different site - Value does not fall within the expected range

I am trying to fire some real basic CSOM calls by button clicks on an HTML form. The only problem is the form needs to be located on one site and the SP.file objects might be located on another site. ...
3
votes
1answer
445 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 ...
1
vote
1answer
60 views

Can we distribute SharePoint DLLs with our application

Is my understanding of following page correct that we can distribute Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll with our application? Like we reference these DLLs in ...
0
votes
1answer
72 views

Unable to return Microsoft.Sharepoint.Client.File object Names filtered by extension

I'm attempting to retrieve a set of File objects filtered by extension. The following code works correctly (without the filter). FolderCollection productModelFolders = ...
0
votes
1answer
156 views

Getting error from display multiple selected external list item javascript

So here's the javascript I use to display item name of selected item from an external list: <script type="text/javascript"> var targetListItem; function ShowSelectedItems() { ...
0
votes
1answer
78 views

Copy SharePoint file from Http to Ftp

Is there a direct way to copy a file from a SharePoint library to an Ftp location? Currently, I'm able to download the document to a local directory using the OpenBinaryDirect method, however this ...