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

learn more… | top users | synonyms

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? ...
3
votes
1answer
239 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
26 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 ...
3
votes
1answer
258 views

How can I increase the allowed execution time for a CSOM Client Context?

I am running SharePoint 2013 and have a Windows app that creates SharePoint sites with CSOM. I have used Powershell to adjust the ClientCallableSettings, lengthening the ExecutionTimeout to 3 ...
0
votes
1answer
51 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 ...
10
votes
4answers
46k 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
107 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 ...
13
votes
4answers
7k 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
3answers
4k views

How do we create Sub Site using JavaScript object module

My using following script to create Sub site. <script src="//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js" <br/> type="text/javascript"><br/> </script><br/> ...
2
votes
1answer
582 views

How to move/copy a document set via JavaScript CSOM

Could somebody give a JavaScript CSOM example of how to move/copy a document set from one document library to another? The document set has a derived content type with a list of metadata, and it ...
1
vote
1answer
326 views

Use GroupBy on ListItemCollection using CSOM

I am trying to do a GroupBy on a bunch of items that I have retrieved using CSOM and when I try do a foreach loop to go through them I get method not supported exception. List contactsList = ...
7
votes
2answers
8k views

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 ...
1
vote
1answer
135 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 ...
1
vote
1answer
41 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 ...
10
votes
2answers
7k 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?
0
votes
2answers
393 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 ...
1
vote
1answer
333 views

Error when adding web part or app part via CSOM remote provisioning to SharePoint page: Specified argument was out of the range of valid values

Problem Adding a web part (or app part) via CSOM remote provisioning to a on-premise SharePoint web part page results in a Specified argument was out of the range of valid values exception ...
6
votes
1answer
76 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 ...
2
votes
3answers
2k views

How to copy the complete folder structure one location to another location include all files and sub folders

I have folder structure like in Shared documents/East using CSOM and C# Main Folder Folder1 Folder2 File1 File2 I have to copy all folders with files to Shared documents/West ....
0
votes
1answer
2k views

Client Context executeQuery() works in console app but returns null object when executed from CRM Server

I have the function GetDocumentLibrary which must return a libray from sharepoint site. When I execute it from a Visual Studio Console Application it works and return the library with all ...
5
votes
1answer
2k views

System.ServiceModel.ServiceActivationException “A relative URI cannot be created because the 'uriString' parameter represents an absolute”

The client object model code in my application is throwing the following exception. How to solve it?. System.ServiceModel.ServiceActivationException: The service '/_vti_bin/client.svc' cannot be ...
1
vote
1answer
111 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
0answers
36 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]; ...
0
votes
2answers
986 views

Get User id from people picker client side

I have created people picker on client side using SPpeoplepicker.js. $("#peoplePickerDiv").spPeoplePicker(); Everything works perfect all user display in people picker and i can select multiple ...
2
votes
2answers
2k views

Remove role from group programmatically, CSOM

I would like to remove the contribute permission level from a specific group. I use this code: Group group1 = web.SiteGroups.GetByName("StudentsKls11"); RoleDefinition readDef = ...
0
votes
0answers
1k views

SP2013 - The object is used in the context different from the one associated with the object

I have a function that initializes a custom taxonomy control, as below (not in myControl.js) function initMyControl() { if (something is true) { var context = new ...
3
votes
2answers
1k views

SharePoint 2013 get all Taxonomy terms JSOM

I am trying to get a collection of terms under a term set so I can see which have custom properties. I have been searching for almost a week now and keep coming up with nothing. I found several ...
3
votes
1answer
4k views

How to add Client Web Parts (App Parts) to a page from JavaScript CSOM?

We're working on a custom way of adding and deleting Web Parts and App Parts to a page in SharePoint 2013. We have to use the new App way of developing and all code has to be using the JavaScript ...
2
votes
2answers
2k views

Upload file into Sharepoint Document set

I'm trying to upload a file to a document set which is located in a library. Im using C# and the Sharepoint Client Object Model - Library, but I can not find any documentation to do this task. I ...
1
vote
1answer
222 views

Find Zone ID of list view webpart remotely

How to find the ZoneID of a list view webpart remotely? We can use any means to get the information; CSOM, JSON, web services or hacks. But we cannot use server-side code. We can know any ...
2
votes
1answer
262 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
26 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, ...
4
votes
3answers
2k views

How to default a Person FormField in New Form Template?

Without using any addons, has anyone discovered a way to set a default value for a <SharePoint:FormField> where the field is a Person/Group? We'd like to default a field on our newform to the ...
0
votes
1answer
234 views

Get a document thumbnail URL using client object model on SharePoint Online

I am working in a SharePoint online based environment and I need to fetch the thumbnail url for a document in a library programmatically, using the .Net client object model (not EcmaScript). Is that ...
0
votes
2answers
5k views

Get Current list item

How to get current (opened) list item using object model. I have a blog which has list named posts. when user opens anyone post, i need to do operation taking that current opened list item. I am using ...
2
votes
1answer
834 views

Copy files/folders between site collection and retaining metadata

I'm using SharePoint 2013 I need to copy files/folders/sub folders from one site collection to different site collection(basically archiving them). I need to do this remotely by using CSOM/JSOM. ...
2
votes
1answer
3k views

Querying for File properties plus ListItemAllFields properties

I'm trying to retrieve both a file's Id in its list, plus its ETag, using the following snippet; using (var clientContext = new ClientContext(webUrl)) { var results = clientContext.Web.Lists ...
8
votes
2answers
3k 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 ...
2
votes
0answers
112 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 ...
4
votes
0answers
605 views

Use CSOM with ADFS credentials from Single Sign-On enabled ASP.NET MVC app

I have the following setup: ADFS 3.0, SharePoint 2013 and the custom ASP.NET MVC app. Both SharePoint and MVC app are configured to use Single Sign-On from ADFS, so once user is logged in via ADFS, ...
5
votes
2answers
6k views

How to modify user profile properties using JavaScript in SharePoint 2013 (Online)?

I need to modify user profile properties using JavaScript (REST or CSOM). How can I do that? I don't see any methods in MSDN documentation about modifying profile properties without server code. ...
5
votes
4answers
1k views

How to access user profile with object model

I need to fetch some properties. How can I access User Profile with Client Object Model? Any code example will be helpful.
0
votes
2answers
1k views

Add hyperlink to Sharepoint list item

I need to add a hyperlink to the Sharepoint (2013) list item in one of the columns or make the list item itself as a link. I don't know how to do this. Any help is appreciated!
3
votes
0answers
36 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 ...
0
votes
1answer
139 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
64 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. ...
2
votes
2answers
3k views

Attach file in CustomList Item using Sharepoint.Client object

Hi is there a way to attach file in specific Custom list item? Currently i tried to add files on the root folder using below code: using (ClientContext context = new ...
0
votes
1answer
2k views

Cannot invoke HTTP DAV request. There is a pending query during OpenBinaryDirect

I've to move some items from one document library to an other one in a different site. I use object client model to do this My issue is having an exception while i'm trying to open the file and here ...
5
votes
2answers
1k views

When using Sharepoint Client Model I get error : The 'Contains' member cannot be used in the expression

When using 'Contains' in Linq query: var camlQuery = new CamlQuery(); var listItems = list.GetItems(camlQuery); var itemQuery = listItems.Where(i => ...
1
vote
2answers
814 views

Sharepoint 2013 publishing page creation using Client Object Model

I am using SharePoint 2013. Is there any way I can programmatically create a page using ONLY th Client Object Model? Also notice that the page should be editable for further use.