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

learn more… | top users | synonyms

0
votes
2answers
255 views

Insert record with Date into list via JSOM, problem with UK Format

I have found that when inserting a record which contains a Date using JSOM the update(); will not work if you specify the format of the date to be UK date (28/05/2014). The code does not error, it ...
1
vote
1answer
183 views

Upload file using JS and REST. Specify content type

I can upload file to SharePoint library using JS and REST. The content type of added file is as library default content type. How can i specify file content type when uploading file? Thanks!
0
votes
1answer
113 views

Get version history of all items in a list

I'm looking for a way to get a list of all the status changes of every item in a SP2007 document library. I want to build some reports that show the average length of time a document spent in a given ...
1
vote
1answer
797 views

CSOM Workflow API InteropService cannot start new instances of Workflows

On my SharePoint Online site, I have created a SharePoint 2010 Site Workflow through SharePoint Designer. Now, I want to create an instance and start that workflow through the CSOM Workflow API. ...
0
votes
1answer
91 views

How to link Title in object model

I am displaying all blog posts Titles on post page. But I want to link those post so that user should click on that. Below is my code. <label id="labelHTML"></label><script ...
1
vote
2answers
200 views

Update Existing Site Content type Column through code

I have a calculated site column. This Site column is used acrossed sites in Content types. Now when I use power shell script to change the Calculated foremule is allowing me to change only in Site ...
0
votes
2answers
3k 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 ...
1
vote
1answer
534 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 ...
0
votes
2answers
611 views

SharePoint hosted APP - Create subsite with JSOM under hostweb - Access is denied

I'm trying to create a SharePoint hosted app that creates a subsite under the hostweb with JSOM. The app has full control on the site collection. Why do i I getting this error message: My code: ...
0
votes
3answers
474 views

Print / display list items on page

I am using SP2010. Using client object model in the CEWP (Content Editor Web Part), I can give alert for each item title. But I want to print all list items on the page. I tried with document.write() ...
0
votes
2answers
306 views

Get the ID of a new listItem and update same record

I'm trying to add a new record and get the new ID created then use the new ID to create a specific reference number using the following code. function saveDraftGHrecord() { ghList = ...
2
votes
2answers
89 views

Which is the best possible way to connect to SharePoint Sites using Client Object Model

I came across a complex situation (imo) which is why I am asking this question. I am developing an application where in, I connect to all SharePoint Sites specified by user and all its sub sites using ...
2
votes
0answers
418 views

Changing the Modified Date of a List Item using the SharePoint Client Object Model (C#) with Contribute Permission

I have a small snippet of code that I use to update the Modified Date of a list item and it works great for users with Full Control permissions. However, for users with just Contribute access to the ...
1
vote
0answers
175 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 information ...
0
votes
1answer
437 views

Update only non read only fields of a SharePoint list using client object model

How to upadate only non read only fields of a SharePoint list using client object model? The code sample is working fine for a particular field like title string siteUrl = ...
1
vote
2answers
2k views

Get/retreive managed metadata column value from Document Library using SharePoint 2013 JSOM

I am trying to retrieve managed metadata column (NewsCategory) value in SharePoint 2013 Document library using JSOM. I get "Object Object" rather than actual value. I tried:- var newsCat = ...
2
votes
2answers
916 views

Get list id from open view page via JavaScript

I have included some javascript in SharePoint master page, I need this javascript to have access to the opened list ID. For example when I load ...
1
vote
0answers
61 views

Check highest priority permission to access folder or file

if any folder or file has more than one permission(e.g. read and full control) for any user or group to access it if i check that permission in code how to check highest priority if folder or file has ...
0
votes
1answer
67 views

SharePoint current user is wrong

If I logged in as a different user in SharePoint below code doesn't show current user logged in user, what is the problem? Web web = clientContext.Web; User user = clientContext.Web.CurrentUser; ...
0
votes
1answer
248 views

Sharepoint CSOM and ensure user

I'm converting a console app into a WCF service and have hit a minor snag. since there are more than 2500+ records to process and for each record I need to ensure the user initials in the list, ...
1
vote
2answers
571 views

Moving documents from one server library to another server library programmatically

I am a beginner in Sharepoint and given a task to write timer jobs. Once triggered, I want to move documents from one Sharepoint server library to another server library programmatically. So far my ...
2
votes
1answer
897 views

Rest Query Managed Metadata Filter

I am currently writing a JSON query for office 365 (sharepoint 2013) where the filter is suppose to filter depending on values returned from a managed metadata field I am trying to filter based on ...
2
votes
2answers
1k views

Rest Javascript Query Managed Metadata field

I am query a list via rest results I retrieve fine in Office 365 (sharepoint 2013). I have two fields of which one is a managed metadata fields. I am looping through the results retrieved but when ...
4
votes
2answers
754 views

Check if logged in user is member of AD group with ECMA script SharePoint 2013

There is active directory group added to SharePoint group. How would we can check that the logged in user is member of that active directory group using ECMA script?
1
vote
1answer
201 views

Updating current item using jslink

I am working on a solution where in I have to update current item based on a button click. I am thinking of using JSLink to generate button with each row, when this button is clicked i have to refer ...
0
votes
2answers
3k views

how to get SharePoint lookup field value using powershell

Can anyone show me how can I get the lookup field value? I used this line of code but it is throwing an error: #$Lookup = new-object ...
0
votes
1answer
351 views

How is Project Site newsfeed accessed by CSOM

I've created a subsite based upon the "Collaboration/Project Site" template. This template creates a newsfeed content of type MicroFeed. I would like to use CSOM to extract the content of the posts ...
0
votes
3answers
272 views

Check if the home page is checked out by the current user

Using JSOM, I would like to check if the home page is checked out, and if the current user is the one who checked-out the page. The test occurs from another page. Here is what I have now: var ...
0
votes
3answers
3k views

Why this code is not working in CSOM: “new SP.UserProfiles.PeopleManager(clientContext)”

This is the code which is not working. I have this code in my dispForm.aspx. <script type="text/javascript"> var personProperties; function getUserProperties() { var ...
0
votes
1answer
77 views

Csom code works if alert is implemented

This code works if i have a alert before , when i remove it, the isUserInList always shows false. Maybe i need to have a return value in CheckIfUserIsInList(); function ? var isUserInList = ...
0
votes
2answers
1k views

SP2013: Get path of current listItem in Javascript/CSOM?

I am customize the DispForm.aspx with some javascript code. I would like to get in javascript the path of the current listitem. How can I do that? UPDATE: I have now this code to get the path/url of ...
2
votes
2answers
1k views

sharepoint csom get address and phonenumber from current user

I am building some CSOM code in my DispForm.aspx. I try to get the current user from the context. This works and I can get the loginName, id, title and email. But I would like to have the address and ...
1
vote
0answers
2k views

The remote server returned an error: (401) Unauthorized. Using CSOM in ASP.NET MVC 4

I'm trying to pull data through SharePoint 2013 BDC Models that I have imported from my ASP.NET application which works fine when I run either locally on my machince or locally on the server. ...
0
votes
0answers
245 views

Simultaneous update, delete and add a list item to a sharepoint List object

In the MSDN documentation for C# CSOM, there are separate examples for adding, updating or deleting a single list item from a sharepoint list object (ListItemCollection) Is it possible to combine ...
0
votes
2answers
825 views

CSOM and Managed Metadata Field

I'm trying to use the Client Side Object Model of SharePoint 2013 to read a managed meta data field but I get null results When I look in the Site Columns, there are 5 fields in the "GroupName" ...
2
votes
0answers
295 views

SharePoint Online CSOM create managed properties

I'm trying to find a way to deploy search managed properties via script to my Office 365 SharePoint tenant. Previously, for on-prem SharePoint I've achieved this using PowerShell - fairly straight ...
1
vote
1answer
362 views

SharePoint CSOM Unit Testing

I am currently using CSOM to upload/download files from SharePoint 2013 sites. I would like to know what would be the best way to unit test my operations. Is there a way I could create a fake ...
0
votes
1answer
251 views

CSOM list item manipulation

Short and sweet : I'm parsing an XML document and adding new job openings into a sharepoint list as well as deleting them if the job id's and deleting them if the particular job id is not present in ...
1
vote
1answer
103 views

Access Items in DocumentSet using JSOM

I'm attempting to access items in a DocumentSet using SharePoint 13's JSOM. I am able to access the generic list properties but I do not see how to access ContentType specific properties on the client ...
1
vote
1answer
1k views

SharePoint Online, javascript get user properties

I'm trying to get some user properties and alert them (I'm going to put them i labels later but just for now I'm using alert). I'm using a content editor with this code: ...
1
vote
1answer
1k views

CSOM vs REST in sharepoint 2013 in terms of performance

CSOM vs REST in sharepoint 2013 in terms of performance and why.I have been having this question for a long time and I have not got a clear picture on this.
1
vote
1answer
295 views

Script to update Sharepoint Online content type

I have a content type "TestContentType" with three columns: Document Type Category Sub-category This content type is used on 18 document libraries, in 3 site collections. The Category column ...
0
votes
0answers
798 views

CSOM OpenBinaryDirect generates 401 error on office 365

I have used same instance of ClientContext inside a RemoteEventReceiver (MinRer.svc.cs) in a provider hosted app to get RootWeb, SubWebs, ListItems and I have added ListItems to lists. It works like a ...
1
vote
1answer
30 views

Get the SUM of Items from Media library in all site collections in SP2010 using JavaScript

How to get the SUM of Item Count from "Media" library in all site collections(more than 100) in SP2010 using JavaScript(or any other way). I've more than 100 site collections and each site collection ...
2
votes
2answers
946 views

delete all files in sub folder CSOM

how to delete all files in subfolder in office 365 using CSOM C#. I have code like particular file only but I need delete all files at a time.
1
vote
1answer
423 views

SharePoint JavaScript Object Model Security and Permissions

I am writing an application whose logic executes in the browser using JSOM. The application might have permissions that exceed that of those who access the application. Let's say the application ...
1
vote
0answers
20 views

Is it possible to query the status of a service application using the client object model?

My goal is to query the statuses of services and service applications from a remote machine. I don't want to actually interact with the services, all I need is the "Started"/"Stopped" status you get ...
5
votes
4answers
2k views

js library for REST and JSOM SharePoint basic tasks

I am just sick of writing again and again the same piece of code to use jsom Async requests, especially when it's for a SP-hosted app which envokes spexecutor. I am sure each developer has his own ...
3
votes
2answers
1k views

Modify Global Navigation CSOM

Can I modify the Global Navigation by using CSOM against a publishing site in SharePoint Online. What I would like to achieve is to hide some of the navigation elements in the global top navigation.
3
votes
3answers
931 views

Query multiple lists in a provider hosted app

I'm currenlty working on a provider hosted app that is hosted in Azure. In this app I need information with multiple lists in multiple sites, which are all in the same sitecollection.I'm basically ...