Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
57 views

Count of documents based on site column content across multiple site collections?

I have a requirement for a dashboard and wondering how to implement in best possible way. I guess CSOM + REST is the only option Requirement: Have multiple site collections with one Document ...
Kannan's user avatar
  • 59
1 vote
1 answer
2k views

Copy Taxonomy Field from one item to another

I use CSOM and I want to copy a taxonomy field from one list item to another. Can someone give me an example of this?
Roman's user avatar
  • 1,343
1 vote
2 answers
2k views

Include all non-system fields for listItems from client-side

Usually for retrieve information from list without system fields we've use code like this: clientContext.Load(logWorkItems, items => items.Include( item => item["Hours_x0020_spent"], ...
Serhii's user avatar
  • 131
0 votes
2 answers
911 views

How we can get the city of current user in sharePoint online

Hi currently i am working on sharePoint online, Where i need to fetch the Current location (city) of the user and on the basis of that i want to get the temperature of that city. using JScript . ...
G.Srinivas's user avatar
4 votes
2 answers
631 views

How does my app log into hosted Sharepoint (Sharepoint Online/Office365)?

I'm new to Sharepoint generally, and need to write an app which will do some basic file management. First, though, it needs to log in. The documentation I've found suggests that: var clientContext = ...
minnmass's user avatar
  • 143
6 votes
1 answer
432 views

(ClientSide) set/update JSlink to CSR files for (all) WebParts, Views, Fields

Working on iCSR.github.io to make CSR development a bit easier. I now want to make it as easy as possible to set the JSlink connections on WebParts, Views or Fields. I have code snippets to do it ...
Danny '365CSI' Engelman's user avatar
1 vote
1 answer
350 views

HTML Webpart JavaScript works in EditForm.aspx but won't in AllItems.aspx

I have a HTML Webpart with the following code (piece): <script type="text/javascript" src="../../SiteAssets/jquery-1.12.0.min.js"></script> <script type="text/javascript" src="../../...
D. Müller's user avatar
3 votes
0 answers
200 views

SharePoint Client Object Model authentication issue

I am using SharePoint.Client to connect to a SharePoint website. The first time it works, but after that I get 401 : Unauthorized error. using (ClientContext context = new ClientContext(...
dare2k's user avatar
  • 131
4 votes
1 answer
5k views

Upload a Folder with Sub-folders and Files Recursively with Pure CSOM?

Can someone please, share a CSOM (C# only) recursive method for uploading a folder with subfolders and files to a SharePoint Online Library? I know about WebDav and FileExplorer, but it's not a ...
Denis Molodtsov's user avatar
0 votes
1 answer
66 views

update list from another list using ECMA/client object model?

I have eleven lists list1,list2,..list10.and listDup Now i want to update ListDup's SID column based on List1's SID . when the time of adding item in List1(List2,List3,..List10) i have to check sid ...
Flying Hope's user avatar
3 votes
0 answers
391 views

SP.ClientContext.Load suddenly throwing uncaught TypeError?

I am trying to start a workflow from JSOM. I just had it working fine, and then I had to change some of the other code in the JavaScript file that is unrelated to the client context or executing ...
Dylan Cristy's user avatar
  • 12.7k
1 vote
1 answer
8k views

C# SharePoint 2013 client object model list item attachment update Error: version conflict

my requirement is I need to update the list item values and if list item contains attachments I need to override with the attachments, delete unused attachments from list item. when I am trying to ...
kavalirakesh's user avatar
6 votes
3 answers
17k views

Cannot contact site at the specified URL on try ClientContext.ExecuteQuery();

I try to get list from remote SharePoint server using CSOM in .NET Web Application, but ClientContext.ExecuteQuery() return exception Cannot contact site at the specified URL If I try to get list ...
Sergey's user avatar
  • 81
2 votes
0 answers
49 views

Desktop application needs to support all versions of SharePoint and SPO

I am connecting to the different SharePoint environments using the CSOM. Whats the best way to deploy the available DLLs to support all SharePoint environments? Do I need to dynamically instantiate ...
monkeyjumps's user avatar
2 votes
1 answer
163 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 ...
Jasper's user avatar
  • 1,264
2 votes
0 answers
332 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 ...
Shishirchandra Prasad's user avatar
1 vote
2 answers
2k 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 ...
Ghoztrider's user avatar
5 votes
1 answer
104 views

Migrate recursive checkbox of calendar from sharepoint 2007 to 2013 programatically

I am trying to migrate SharePoint calendar from 2007 to 2013 programatically. Here is my code. using (ClientContext clientcontext = new ClientContext(targetURL)) { clientcontext.Credentials = ...
Anil Pal's user avatar
  • 1,079
1 vote
1 answer
618 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 ...
Milind's user avatar
  • 1,548
3 votes
0 answers
366 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 ...
balaji's user avatar
  • 31
0 votes
3 answers
4k 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 ...
amsackett's user avatar
  • 379
2 votes
1 answer
404 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 ...
Natalie's user avatar
  • 285
8 votes
1 answer
8k views

Differing ways to make executeQueryAsync calls - Function.createDelegate (is old IE8 code)

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 ...
Orange Juice Jones's user avatar
2 votes
1 answer
914 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. ...
Ishan's user avatar
  • 774
3 votes
3 answers
1k 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 /_layouts/...
christopher clark's user avatar
1 vote
2 answers
1k 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 ...
Prakash's user avatar
  • 666
0 votes
1 answer
907 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?
vilmarci's user avatar
  • 906
3 votes
1 answer
12k 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 ...
user49318's user avatar
4 votes
1 answer
2k 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 ...
Suresh Kumar Senapati's user avatar
0 votes
1 answer
2k 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 ...
Sivakumar Piratheeban's user avatar
0 votes
1 answer
1k 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 ...
user avatar
2 votes
1 answer
252 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? ...
Emiliano Poggi's user avatar
1 vote
1 answer
4k 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 ...
Mahesh's user avatar
  • 111
1 vote
1 answer
158 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 ...
Jahangir Alame's user avatar
1 vote
1 answer
3k 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 ...
Kb15's user avatar
  • 155
6 votes
1 answer
3k 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 ...
SP Enthusiast's user avatar
1 vote
1 answer
926 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 ...
Steve's user avatar
  • 83
1 vote
0 answers
958 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
SP Enthusiast's user avatar
7 votes
5 answers
48k 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 ...
SP Enthusiast's user avatar
2 votes
1 answer
2k 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 = SP....
KidBatman's user avatar
  • 381
0 votes
2 answers
92 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, ...
Ola's user avatar
  • 4,405
2 votes
0 answers
413 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 ...
Chris McAtackney's user avatar
4 votes
0 answers
506 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 ...
NLV's user avatar
  • 490
1 vote
1 answer
3k 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 ...
Swayam Siddha's user avatar
2 votes
1 answer
1k 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. ...
chakri's user avatar
  • 321
1 vote
2 answers
316 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 ...
Ola's user avatar
  • 4,405
0 votes
1 answer
101 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 ...
Shashikant Oberoi's user avatar
2 votes
2 answers
717 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 ...
Dan Hastings's user avatar
9 votes
2 answers
16k 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 ...
GrantMcW's user avatar
  • 411
1 vote
0 answers
965 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 ...
Dan Hastings's user avatar

1
3 4
5
6 7
37