Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

CSOM Iterate all SiteCollection in an SPO Tenant

I am trying to iterate over all site collections in a SharePoint Online Tenant. I found this code on the web and adapted it to my needs: context = SharePointContextProvider.Current....
0
votes
0answers
13 views

Accessing SP List using Rest-APi

var url = serverRelativeUrl + "MyServer/_api/web/lists/GetByTitle('Test')/items"; var httpRequest = $http({ method: 'GET', url: url, crossDomain: true, ...
2
votes
3answers
2k views

Stop workflow associated to a list via JSOM

I want to stop a workflow when user clicks on the Cancel request button. To achieve this I am trying with the JSOM code. My code as follows SP.SOD.executeOrDelayUntilScriptLoaded(function(){ SP....
2
votes
1answer
1k views

Does audiences work with CSOM?

If we build an SharePoint app and need to show items based on audience targeting, can we use CSOM for that? Can't find any references to it in the CSOM SDK.
0
votes
2answers
1k views

How to handle list item events from client side using JSOM?

My requirement is like - When an item is added to a list, a log should be added to another list? And this needs be done using JSOM. is there a way to achieve this using JSOM?
3
votes
1answer
3k views

Sharepoint client object model {File not found}

var onlineCredentials = new SharePointOnlineCredentials(ServiceUserName,securePassword); var context = new ClientContext(clientUrl); context.Credentials = onlineCredentials; ar cc = GetAllFiles(...
5
votes
1answer
1k views

Dynamically create metadata and associate it with File using Client Object Model

Is there any way to dynamically add metadata in the upload file. I am using the following code in this regard. File uploadFile = context.Web.GetFileByServerRelativeUrl(location); //check out to make ...
3
votes
1answer
1k views

502 DNS lookup failed error when using SharePoint 2013 CSOM

I am facing an issue while using CSOM in SharePoint 2013. I have configured an alternate access mapping for our site to run on http://mycustomdoamin.net/ The site is running fine and I am able to see ...
3
votes
1answer
2k views

CSOM The request uses too many resources error while provisioning web

I am provisioning web on SharePoint online using following CSOM code(provided hosted app), but intermediately we are getting "The request uses too many resources" error. using (ClientContext ...
0
votes
2answers
663 views

Get additional column values from selected item in list view using Javascript\JQuery

I'm currently using JS (items[i].id;) to successfully get the id of selected items in a list view, however, I would like to pull column values from the selected row(s) like "Title" etc. if possible ...
0
votes
1answer
1k views

Update editor of published version without affecting version number - CSOM

I am trying to copy files from one site collection to another including their version history and preserve the metadata using CSOM. I am almost there using the below logic for each version of the file....
4
votes
2answers
7k views

Specify item fields to Load using SharePoint 2010 Client OM

How can I dynamically generate/specify a list of item fields I want to load when querying a list using the Client OM? This is possible to do using the tag on the CAML query, but this loads additional ...
1
vote
0answers
19 views

Retrieve share links via CSOM

I currently have a program that will upload selected files to specific folder on SharePoint and give access to specific users based on their emails using the SharePoint CSOM API, however I am unable ...
6
votes
2answers
3k 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 ...
3
votes
4answers
10k views

Create list from custom template using csom, c#

I would like to create a list based on a template (.stp uploaded to the list template gallery), it almost works with this code: ClientContext context = new ClientContext("<Your Site URL>"); ...
3
votes
1answer
3k 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
1answer
612 views

How to edit SharePoint page content/URL using client Object Model

I have SharePoint Site on SharePoint online with Pages library having 5 pages with content. Need to modify the URL in the pages programmatically using Client Object Model suppose I have Newname.aspx ...
1
vote
1answer
31 views

Access Root Site List from Sub site using Remote Event Receiver in SharePoint Online

I am trying to access the Root site list using the sub site client context. But when I try to execute the clientcontext it gives Access Denied error. I tried to create new clientcontext by passing ...
1
vote
1answer
74 views

Execute CSOM code from .net core

Is there any option to execute CSOM code from .net core application? I have a bot solution from this i need to store all the conversation details in SharePoint list. When executing the code, i am ...
0
votes
2answers
643 views

Synchronize excel file with SharePoint online list

I want to synchronize data from excel file with SharePoint list on office 365. I have already built a utility which uses client object model to achieve this but it is very slow as item count are in ...
0
votes
1answer
35 views

Update a list item using Client side object module code and prevent sharepoint list workflow 2013 from been executed

I have a custom list inside our sharepoint online classic team site collection. and i define a workflow 2013 on the custom list. where the workflow will be executed when creating and editing the list ...
1
vote
1answer
798 views

How to get url of file after uploading to document library?

How do you return the URL of a file after it has been uploaded to a document library, using the default upload page? Returning the text from the "inputFile" textbox from the upload.aspx page would ...
0
votes
1answer
658 views

Getting Filtered results by Date column from a list with BCS and SharePoint 2010 JavaScript Client Object Model

I'm trying to get the filtered results by a column type DateTime from a list filled with BCS using JavaScript. I've tried everything to get those results with query like: "<Where>" + "<...
4
votes
1answer
9k views

Check- in & check-out files using client object model

As the title says, how can I Check- in & check-out files using client object model?
1
vote
1answer
673 views

List does not exist when trying to startworkflowonlistitem from CSOM

Using SharePoint 2013 on Windows Server 2012 Standard. I believe this is an issue with permissions. When trying to start a workflow on a staging server, the following exception happens (as shown in ...
1
vote
2answers
734 views

Create external users using CSOM

Does anyone know if it's possible to invite external users with the client object model or is this only possible in the UI?
0
votes
1answer
738 views

Creating list item from outlook mail

I have a requirement where I have to update list item in a list fetching values from an e-mail. I have to create a button in the outlook ribbon, clicking on which the values (in key-value pair) should ...
1
vote
1answer
697 views

Get list at site collection level using SP.js

I have this code which is meant to get data from a list at the site collection level. var clientContext = new SP.ClientContext.get_current(); var oList = clientContext.get_site().openWeb()....
0
votes
1answer
757 views

REST addViewField “Cannot handle the data at position 0.”

I'm currently writing an initialisation script for a SharePoint-hosted application which checks if a list (used for launcher items) exists. If it doesn't, then it runs through a series of processes to ...
1
vote
2answers
692 views

Group permission - Sharepoint Online Powershell

I would like to have a report of which sites a specific group or user has on all the SharePoint sites. I have this group called SPGroup and I want to see on which sites this group has permissions on, ...
2
votes
1answer
712 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. ...
4
votes
2answers
3k views

What are the advantages of using SP Services?

What advantages would I gain by using the SP Services library in SharePoint releases 2010 and later? The 2013 (and even the 2010) JavaScript Object Model and REST API seem to cover a significant ...
0
votes
1answer
748 views

Option to upload and download file to SharePoint Document library

I want to give option to user on .aspx page to upload and download file to SharePoint Document library. I created an ASPX form page. There is an option to upload / download the document for storage. ...
2
votes
1answer
702 views

Change content type order via Javascript/ECMAscript

In my SharePoint-hosted app, I use javascript to apply a content type called "Order" to a list in my app. When users click "new item" to upload a document, I want that document to derive from my new ...
1
vote
1answer
688 views

Upload javascript file to sharepoint online library saved in wrong format

I am trying to Upload a myfile.min.js to sharepoint online using JavaScript using JSOM but its stored as wrong encosing format var req = jQuery.ajax({ url: sourceFileItem + '?ver=' + (...
0
votes
1answer
970 views

How to get site Owners information from sharepoint site using CSOM?

I have root site and it has many subsites. I have to get Site owners of each subsite using CMOS. I have writtern below code but its not giving owner's detials instead its giving all site group ...
1
vote
1answer
768 views

Remote App using CSOM against SP2013 with Claims

We have a few applications that currently use managed code CSOM against SP2010 - think of SharePoint as simply a large file store. The UI is not used at all and all the functionality for the remote ...
0
votes
1answer
776 views

Authenticate user with FormDigest via CSOM/REST

Our SharePoint 2013 farm is using Windows Authentication and exposed to the Internet. We have a webparts contains javascript AJAX call to another server with a different hostname. Intranet: intranet....
0
votes
1answer
891 views

How to get Sharepoint 2013 variation URL?

I want to create a toggle button for variations, so that when I am on the en or fr page, and I click the button it takes me to the other page. But I can't just change the en to fr, for example, ...
1
vote
2answers
1k views

Cannot query SP.UserProfiles.PeopleManager from the App Web via REST

I'm testing REST results in the browser with mixed results. The following URL returns the expected result: https://xxxxx.sharepoint.com/sites/site/_api/SP.UserProfiles.PeopleManager/...
3
votes
3answers
352 views

CSOM / Webservice multilingual provisioning site columns, lists,

Is it possible in SharePoint 2013 to create site columns, content types, lists, libraries, ... in different languages (so, with different display names) by CSOM (client server object model) or a ...
0
votes
1answer
750 views

Get document from Document Library using Javascript

I am trying to get a document from document library.I am getting the file but I can't get its binary value. $.ajax({ url: fileUrl, binaryStringResponseBody: true, headers: { "...
1
vote
1answer
939 views

How to get the URL of an item's parent web in JavaScript?

Given an absolute URL to an item, like: http://server/sites/mysite/myweb/Lists/MyList/DispForm.aspx?ID=1 or the absolute URL to the item's parent list, like: http://server/sites/mysite/myweb/Lists/...
1
vote
1answer
801 views

How to get server datetime without postback using JSOM or services

My application page may be long time without reloading, and user changed system date and time. And I need to know datetime from server, not from client.
1
vote
2answers
332 views

Can I get site Usage in Sharepoint online using CSOM?

I want to get the "Site Usage Report" on a Sharepoint Online site using C#. How can I do it? This link provides solutions to get these details but I want to do it programatically using C# (CSOM). ...
2
votes
1answer
1k 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
1answer
2k views

How to pass user's identity to Client Object Model when using ASP.net?

How can I pass an authenticated user's identity through the Client-Object Model? SP 2010, Client Object Model code is on an IIS server. I want to pass the already authenticated Windows user to ...
1
vote
1answer
827 views

Sharepoint javascript object model, access denied error

I'm using JavaScript object model to retrieve data from a list located a root site. My code is as below: var clientContext; SP.SOD.executeFunc('sp.js', 'SP.ClientContext', ...
0
votes
1answer
777 views

Retrieve file version metadata with CSOM

My organization is requiring that we rewrite all of our sandbox solutions as we shift to SP 2013 as provider-hosted apps using CSOM. One of the event receivers I wrote would previously use the ...
2
votes
1answer
788 views

Manage files with no checked in version - CAML query

I am using Office 365. We have a document library containing more than 12000+ documents, with a number of folders and subfolders. I need to find a way to get all document which have no checked in ...