Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
944 views

Get Sharepoint Permissions\Roles (custom) of a user from AD Group that is part of SP Group via CSOM

SharePoint 2013 + provider-hosted app. User is part of AD group. AD group is part of Sharepoint group. Sharepoint group has custom security permissions assigned. How do I check whether user has some ...
1
vote
1answer
706 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()....
1
vote
1answer
686 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 ...
0
votes
1answer
788 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 ...
3
votes
1answer
6k 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 through IIS ...
0
votes
1answer
767 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 ...
2
votes
1answer
708 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 ...
2
votes
1answer
730 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. ...
1
vote
2answers
725 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, ...
0
votes
1answer
759 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. ...
0
votes
1answer
1k 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 ...
0
votes
1answer
907 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, ...
0
votes
1answer
803 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
772 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
804 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.
2
votes
1answer
792 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 ...
0
votes
1answer
34 views

The property or field 'ItemCount' has not been initialized. It has not been requested or the request has not been executed

I have the following code inside our server-side event receiver, the code should connect to a sharepoint online list and get the total number of items, here is the code:- try { currentItem[...
0
votes
2answers
37 views

Displaying list items via SP.ClientContext

I am currently using SP.ClientContext via JavaScript to display items from a SharePoint list. I am able to display the items via an alert or via input button onClick to display the data. However, I ...
0
votes
1answer
954 views

Taxonomy control in SharePoint hosted app

I am creating an SharePoint hosted app. In that I have to use Managed MataData from my list. In this I am getting the Metadata from my list column to my Taxonomy control. I have find some post but I ...
0
votes
1answer
786 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 ...
36
votes
5answers
50k views

How to get List by Url using SharePoint 2013 CSOM

SharePoint 2013 CSOM API contains the following methods for accessing List object: ListCollection.GetById method - returns the list with the specified list identifier ListCollection.GetByTitle method ...
0
votes
0answers
29 views

How to update content in a file?

I need to be able update a text file (basically adding a line at the end of the text file with log details) that is in a document library. Is it possible do this with PowerShell CSOM? I have to code ...
0
votes
1answer
879 views

Search Configuration Import CSOM

I'm trying to import a search configuration XML using a SharePoint App. I have check the following: The XML is correct. I can upload it manually. The code works using a console app, but not using ...
0
votes
2answers
1k views

Forms Authentication in Sharepoint 2013, _vti_bin/authentication.asmx error

I'm getting this error when using CSOM in a FBA web application that is configured agains't a custom FBA provider. I'm getting this error when site is configured for Forms, if a disable forms with ...
0
votes
1answer
914 views

Use content from Microsoft.SharePoint.Client.File

I have a Microsoft.SharePoint.Client.File called "Algemeen.aspx" that i got from SharePoint 2010. Now i need to get the content from that file in my vb.net application. Does anyone know how this is ...
1
vote
2answers
1k views

SP.UI.ModalDialog Namespace or Reference

Is there any server side reference for SP.UI.ModalDialog? What is the reference for SP.UI.ModalDialog for client side? How i reference this in webpart?
1
vote
1answer
2k views

Looking to retrieve user's groups in SharePoint

I am running SharePoint Foundation 2010. I have a claims based site setup to use a trusted token provider. I am passing it a set of claims that determine the user's group. They look similar to this: ...
0
votes
1answer
987 views

How to get ID field in form through internal name in SharePoint

I'm learning Sharepoint 2013 . I have a new form to add data . In that form i have a web part add javascript . In that script i want add code custom this form and i want get ID through internal name ...
0
votes
1answer
986 views

The property or field has not been initialized. Error throw in sharepoint online?

I have big problem. I tried a lot of solution for this issue but not worked. I need help. Here is my code. I try to get items from picture library. It's an app for sharepoint online. var context; var ...
7
votes
2answers
4k views

How to change 'Modified By' column value when a new file is uploaded in SharePoint 2013 using Client Object Model?

I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The ...
1
vote
1answer
877 views

current user is always is administrator on a SharePoint App

I have tried following solution to check the current user's permissions on the current host web in a SharePoint hosted app, however the user is always administrator. function sharePointReady() { ...
0
votes
1answer
918 views

Reset sharepoint lookup with None option using jquery

How to reset the lookup value to None in Editform.aspx page using Jquery. I want to empty the lookup dropdown if text box does not have any value . Here is the code which i have tried.I was able to ...
1
vote
2answers
920 views

Client Object Model RoleDefinitionBindingCollection.Remove not working

I'm using the Client Object Model and trying to remove a specific RoleDefinition from a RoleDefinitionBindingCollection in a RoleAssignment. This is the code I'm using: Web web = context.Web;...
0
votes
1answer
1k views

User or group column is populated with incorrect values when adding data from CSOM

I am working on a console application that updates list items using managed CSOM. I have a user or group column in this list that can contain multiple values. Now, I am using below code to update the ...
1
vote
2answers
733 views

SharePoint Online: Get Document Library Children Count Using CSOM

My requirement is to get the children item count of Document Library using CSOM. The count should only be the immediate children count, and should not include the sub-children count. I am trying to ...
3
votes
2answers
880 views

Get object of ribbon button in JavaScript

I am trying to access the ribbon button via JavaScript. Below is my code: // Get the page manager var ribbonPageMgr = SP.Ribbon.PageManager.get_instance(); // Get the ribbon var ribbon = ...
0
votes
1answer
994 views

Error Unable to get property 'getEnumerator' of undefined or null reference

Getting the following error when running my script: Unable to get property 'getEnumerator' of undefined or null reference My code : NBSFeedbackEditInbox.FeedbackRemove = (function () { var ...
0
votes
1answer
1k views

Check In file with Javascript and REST

I am trying to check in a file from my sharepoint-hosted app with jsom and rest, but it wont work my code look like this: function checkInFile() { var hostUrl = decodeURIComponent(...
2
votes
1answer
1k views

SharePoint 2010 Javascript JSOM creating a List View Web Part using javascript

I was able to follow along and add a Content Editor web part to a page using javascript from MSDN here. I am now interested in trying to find a way to add a List View or Data View web part to a page ...
2
votes
3answers
5k views

Is it possible to refer to a field hidden in current view from JSLink attached to current view?

I have the following JavaScript code attached to List's JSLink property: (function () { var coloringFieldContext = {}; coloringFieldContext.Templates = {}; coloringFieldContext....
1
vote
2answers
380 views

To connect to SharePoint Online Client Context using browser credentials from powershell

I am using below code to connect to SPO from powershell, but we have multi factor authentication in SharePoint. So I want to give credentials from browser instead of script. Please suggest as i ...
1
vote
2answers
1k views

Is there any way to overcome URL length limitation in REST API “GET” Requests?

Is there any way to overcome the 2083 characters limit using REST API GET request itself.
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
15 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 ...