Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
29 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
35 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
1answer
33 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 ...
0
votes
0answers
11 views

Clientcontext is always null in azure hosted Provider hosted app

I am working on provider hosted app to be hosted on azure. I need to create remote event recevier, I am using https://blogs.msdn.microsoft.com/kaevans/2014/02/26/attaching-remote-event-receivers-to-...
0
votes
1answer
39 views

How to insert list items using JavaScript Object Model in SP

I am trying to insert list item's value through JavaScript object model in SP. When I call set_item('fieldname','Title'), it throw error "c.set_item is not a function". How to successfully Insert a ...
1
vote
1answer
50 views

Create GUID for each item created or added to a list.Using JSOM

Trying to create a unique ID(not sequential which is preferably an alpha numeric unique ID) for each row item added. The same I have tried using an EXCEL formula, but how to integrate it with ...
1
vote
1answer
26 views

Sharepoint client object model “File not found” Powershell

I have some issue when i try to create a folder, but the same issue come out when i try create file too. this is a sample of my code : $web_sp = $session_sp.Web $session_sp.Load($web_sp) $session_sp....
0
votes
0answers
44 views

Set file metadata directly on upload for records library with CSOM

I have the following issue: I want to upload a file to a library (with CSOM C#) that automatically declares all new files/items as records. The site collection setting for records is set to prevent ...
0
votes
0answers
11 views

Save site as template in sharepoint online using CSOM Approach

can anybody help us how to save site as template in sharepoint online using Client Object Model approach (CSOM C#)? any help would be appreciated
0
votes
0answers
36 views

unable to connect with SharePoint site using CSOM

I am trying to connect to SharePoint 2013 site with CSOM using a function with 2 arguments. When i am giving only $x that is site URL as argument then code is working fine but when i am giving two ...
1
vote
0answers
45 views

Provider hosted app: TokenHelper not authorized to get context

I followed this tutorial to deploy Provider Hosted App to production environment. It has a proper SSL certificate installed, it's registered within SharePoint and TokenHelper class is modified. App ...
1
vote
1answer
41 views

Logging client side error(JS file added in a visual webpart) to server side - sharepoint 2016

I have a visual webpart, where there is a JS file added to it. Now i need to log the errors which occur in the JS to my local drive. What we need to know is how to push the error message from client ...
0
votes
0answers
28 views

Programatic access to sharepoint with CSOM with Full Control permission

I would want to create some automation on my site , currently my organization provides only full control access to the site.. is it possible to run CSOM C# code to create list items. since i am part ...
0
votes
1answer
64 views

Cannot access SharePoint online _layouts pages using powershell

Would appreciate some help here. Using the following powershell code I can access all Sharepoint online web pages but for any page containing _layouts I get: Exception calling "DownloadString" ...
1
vote
1answer
547 views

Object doesn't support property or method 'readAsBinaryString' IE 11

I am using xlsx.core.min.js to upload excel files to SP and pass their contents to a new list. I have it working in Edge but it will not work in IE 11. The first console error I received was "Object ...
1
vote
1answer
290 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
1answer
37 views

How to get client assemblies within a Non SharePoint Machine?

I am running CSOM code in PowerShell to access data of SharePoint 2013 sites. I am adding below lines to load the DLLs in my machine. These lines expect these DLLs to be present in this location. Add-...
1
vote
0answers
60 views

Installing a Remote Event Receiver Add-in - System.IdentityModel.Tokens.SecurityTokenException

I'm working with a Remote Event Receiver Add-in in SharePoint Online and when I try to install the Add-in the breakpoint at the HandleAppInstalled(); fires, but when it tries to use ClientContext to ...
0
votes
1answer
130 views

Floating button to submit new list item

I am trying to find information on creating a button that I can have "float" at the bottom right or left of a SharePoint page that when clicked will open a dialog box for a new list item to be saved. ...
0
votes
1answer
33 views

TaxonomyInternalService.GetSuggestions Microsoft.Sharepoint.Client equivalent

With the TaxonomyInternalService.json/GetSuggestions endpoint, I can retrieve all terms with synonyms that start with some specified text. I am attempting to do this with Microsoft.SharePoint.Client....
1
vote
0answers
40 views

Save document template from AppWeb to HostWeb document library

I am trying to create SharePoint app. Basic idea is to create document in hostweb document library from AppWeb (document template stored in AppWeb doc lib). In Details : I have created ribbon ...
0
votes
1answer
81 views

Is there is any way to create popup form on button click in SharePoint Add-In

I am trying to create popup form on button click when i click on "create document" button then popup will be open and on that popup form i need one text box and button. please let me know how can i ...
0
votes
1answer
22 views

problem with deleting and creating same look up field in a picture library

in my project, there is a picture library with a look field. I delete and create this lookup field like that : function MajBibliPhotoGare() { var clientContext =SP.ClientContext.get_current(); ...
1
vote
2answers
311 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). ...
0
votes
3answers
114 views

Call a executeQueryAsync function inside success of a function

I am able to fetch single SharePoint List using JavaScript. But here I need to Query other list based on the value fetched from first list. I have also used angularjs for the page. Find the below ...
1
vote
1answer
546 views

How to use CSOM TermSet.GetTerms method? Receiving strange null error

I have a piece of code in which I want to check if a specific Term is available within a TermSet. The TermSet is quite large, so getting all Terms is no option here. My code looks like this: Getting ...
1
vote
1answer
79 views

How to bind SP.PermissionKind Enumeration to a dropdown list using jquery

I need help as I have a requirement to get all permissions (PermissionKind Enumeration)and bind it to a drop-down. Also, I need help to know what are the different ways to bind Enumerator value using ...
1
vote
1answer
24 views

SharePoint Client Object Model - Javascript or .Net?

We currently have a SharePoint 2010 environment and planning to migrate to SP 2016(Q2 2019). For SP 2010 we have developed a component to developers that want to consume SharePoint infrastructure. ...
0
votes
2answers
287 views

get items from a image library and bind using foreach loop with multiple HTML image ID using JSOM

I am trying to create an image slider using JQuery where I am facing difficulty to bind multiple images to HTML labels. As I have already used in while loop how to use this using for each loop to ...
0
votes
1answer
201 views

PropertyOrFieldNotInitializedException on SharePoint Online CSOM

I am trying to write a simple Console Application in .NET using the CSOM object model. I write the following code (omitted the client context declaration and the authentication parts from below): ...
0
votes
1answer
49 views

Copy/Delete Sharpeoint Library items to another Sharpeoint Library between date using CSOM

I hope you can help with this topic, please explain the scenario. I have a site in Sharepoint online. -I have an origin (Sharepoint library) that contains photos. My doubt is how to copy the items (...
2
votes
0answers
16 views

Save file in same document set it is opened from

I have a request from a customer I am struggling with. Given is the following scenario: SharePoint Server 2016 Whenever a new document set is created a specific Excel file is added to the document ...
1
vote
2answers
60 views

Update list column data via HTML form web part

I'm trying to update list data on Sharepoint via HTML web part. This is my update function: function UpdateListItems( ids ) { var response = getNode( '<?xml version="1.0" encoding=...
0
votes
1answer
537 views

Property bag - Index using CSOM

How can we check if the property bag is indexed and searchable? And also how is the index value for 'vti_indexedpropertykeys' encoded? I am trying to update the property bag's index using CSOM C# ...
0
votes
1answer
50 views

When adding item to List, I get error Invalid data has been used to update the list item. The field you are trying to update may be read only

I'm using Client Object Model to update a list on SharePoint. The list is very simple, it only has 3 columns ([Title], [Author], [Year Published]) [Title] is the standard column added by default, [...
0
votes
1answer
122 views

Thumbnail of share point files

I want to display the thumbnail of SharePoint image or pdf file. In Google Drive case from Thumbnaillink we are getting thumbnail URL. Like that is there any property or api is available in SharePoint?...
0
votes
1answer
91 views

Retrieve email from People or Group Field

I have People or Group Field Normally I retrieve value of fields as: var fieldUsuario = ctx.CurrentItem.Notificar_x0020_a But now I dont want text value, I debbug it and it have email in span as: &...
1
vote
2answers
401 views

Error of can not invoke method or retrieve property from a null object

I am using C# Winforms and CSOM - am attempting to return the version history with this method. I have verified that all variables being passed in hold an appropriate and correct value. But once the ...
0
votes
1answer
128 views

Clear radiobutton list selection using jquery

I would like to clear Radiobutton list selection once user click the button. I have tried the following code but clears the selection in browser. When I access from backend(C#) selection is there. It ...
0
votes
1answer
906 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
142 views

Rest API filter syntax error

i am getting invalid error on the below error. I couldnt make out what the error was. url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('Mega Menu')/items?$select=...
1
vote
2answers
101 views

How to assign personal view to specific user?

Usually I create view using ViewCreationInformation class: public static void Create(this ViewCollection viewCollection, IListView view, string desiredTitle, ContentTypeId contentTypeId) { //...
2
votes
0answers
46 views

Java Script How can I get the Site Owners information and the Group Name for all my sites

I have zero experience coding in SharePoint and have been given the task of showing the current Site owners within an HTML control on EVERY page for our site. I found this code at this link which ...
0
votes
2answers
1k views

Office 365 document Get a link View Edit URL using C# client object model

I was trying to get the URL of a document (inside document library) link same as Get a Link option with View (account required).I am using following code with sharing options. SharingInfo object does ...
1
vote
1answer
78 views

How to get group by group name in JSOM SP2010?

How to get group object from group name something like this. var groupCollection = clientContext.get_web().get_siteGroups(); group = groupCollection.getByName("Group Name"); Above code will work in ...
1
vote
2answers
1k views

How to set up CSOM in Visual Studio?

Our Sharepoint site is on our company servers. I need to create a web app that can retrieve and post data from and to that site. I use VS 2017, I tried to install Microsoft.Sharepoint.Client using ...
2
votes
0answers
249 views

Authenticate user in embedded iframe using session of current SharePoint user

I have an iframe with my web application embedded to a SharePoint page. I need to somehow authenticate him/her in this web app using Microsoft Azure AD without forcing him/her to enter login and ...
0
votes
1answer
314 views

Page Layout and Site Template Settings - Properties using PowerShell

I have a requirement where I need to access the Site Templates and Page Layouts and the Default Page layout. I'm able to access all the properties using $web.AllProperties["__WebTemplates"] $web....
0
votes
1answer
25 views

SP 2010: Create list item in a different site which is in a different web app

Is it possible to create list items in a site which is in a different web application using JSOM?
0
votes
2answers
798 views

Conditionally hide a metadata field based on user's permission

I am working on an office 365 online SharePoint site collection. I have added a custom list inside my site collection. The site collection has the built-in group named "Owner", so is there a way ...