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

learn more… | top users | synonyms (1)

2
votes
3answers
1k views

How to use “SPContext.Current.Web.Url” in client object model?

When working with server side code we can use the following line to obtain the url of the current web site: var url = SPContext.Current.Web.Url; How can we do the same when working with the client ...
1
vote
1answer
325 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
20 views

Why does my console output contain html tags for some field values?

I created a custom list which contains different field values e.g. Text Choice Note Currency Peoplepicker Using the following code I print the field values to console: List mealList = ...
0
votes
1answer
18 views

How do I integration test an SharePoint Online App?

It is my understanding that if I want to do integration testing of Apps for SPO I first and foremost need a tenant to do the testing on. The problem is, how do I run the tests? Ideally I want to use a ...
1
vote
0answers
13 views

How to convert TimeZoneInformation into TimeZoneInfo

I need get TimeZoneInfo object that represent timezone on SharePoint Server. In client object model I found object Web.RegionalSettings.TimeZone (Class TimeZoneInformation). How I can convert ...
2
votes
1answer
732 views

System.ServiceModel.ServiceActivationException “A relative URI cannot be created because the 'uriString' parameter represents an absolute”

The client object model code in my application is throwing the following exception. How to solve it?. System.ServiceModel.ServiceActivationException: The service '/_vti_bin/client.svc' cannot be ...
0
votes
1answer
330 views

List Onload event

What I want to do: I have a custom list that contains a lot of items. When an user loads the list, all items of his view should be checked. If there is a special value in the listitem a notifiaction ...
1
vote
2answers
83 views

How to get title and url using allproperties

How can I get title and url using allproperties? I can get custom proeprty but do not know how to get title and url. I am not able to know as why I get the alert twice in the following code, ...
0
votes
1answer
1k views

SPDiagnosticsService.WriteTrace throws error “Object reference not set to an instance of an object”

I am trying to write entries into logging and have trouble doing so. Using Client object model on SharePoint foundation. Code is running from a console app. SPDiagnosticsService.Local.WriteTrace(0, ...
1
vote
1answer
103 views

Get list of installed apps using Client Object Model

I have been trying hard to find any example, resource which explains how to get a list of installed apps in SharePoint 2013 environment using Client Object Model. So far I have found nothing. Could ...
0
votes
1answer
758 views

Get all subsites of top level site using JavaScript OM

I am trying to get all sub sites of the top level site. However, the code I wrote for the app returns zero subsites. I am a little mystified as to why: var context = SP.ClientContext.get_current(); ...
2
votes
4answers
4k views

Client Object Model gives 401 when impersonating logged in user - MVC App

I have an ASP.NET MVC app that connects to SharePoint 2010 via the Client OM. When I run ExecuteQuery(), I get a HTTP 401 error from SharePoint. I have the MVC app set to impersonate the logged in ...
0
votes
1answer
21 views

Unable to trigger workflow

A sharepoint info path form calls this ASMX web service. The webservice inserts items into a sharepoint list like so... item["Area"] = Area; ...
1
vote
3answers
982 views

List API get all items limited to 100 rows

When doing a GET call to the List API from JavaScript: "/_api/web/lists/GetByTitle('ListName')/items" the results returned are limited to 100 rows. Is there any way to return more rows in the result, ...
4
votes
2answers
3k views

Remove “Add new item” functionality from lists

I have lists where the items are created from nintex workflows. I need to prevent the users from adding list items manually, as the workflows ensure dependencies. Revoking the add item permission is ...
0
votes
2answers
353 views

Get current language via Client Object Model

I need to get the current display language of a web via Client Object Model (C#) from a provider-hosted App. The app runs inside a Client Web Part (IFrame). I am aware of this solution but think it is ...
1
vote
3answers
90 views

Can I programatically move sites or content between 2007 and 2010?

Using the SharePoint Object Model on a SharePoint 2007 environment and the remote object model to talk to a SharePoint 2010 environment would it theoretically be possible to migrate sites or content ...
1
vote
2answers
472 views

accessing the SP2013 Site Settings-->Master Page/Navigation settings etc using CSOM (client side object model)

I want to access the SP2013 Site Settings-->Master Page/Navigation settings etc using CSOM (client side object model) using JavaScript or REST service or Webservice which I can call from Javascript. ...
1
vote
1answer
548 views

Getting user email from a List Item column using Javascript

I am creating a Hosted app using NAPA on Sharepoint 2013 (Office365). I need to retrive a user from a list column and get the user's email. SP.List.getItems with a query returns a listEnumerator ...
1
vote
1answer
196 views

How to add Pragma No-Cache to Client Object Model Request

In developing an application that uses the SharePoint Client Object Model, we noticed that the application is not working correctly using Safari on our iPad devices. When testing on our desktops, we ...
0
votes
1answer
365 views

Import bulk data (over 5000 List Items) into SharePoint

I have an Microsoft Office 2010 AddIn which imports Data into SharePoint. The tool creates a Dictionary with over 5000 Values. Every Value is a C#-Class with Data and represents a SharePoint List ...
1
vote
1answer
511 views

set or update multiple values cascading lookup field using client object model

I'm struggling since a couple of weeks with setting a multiple values cascading lookup field using a client object model, I could set the first value but then It show me an error of invalid lookup ...
3
votes
1answer
39 views

Access Selected Items from List View

The following returns selected items correctly from standard list and document library types. var context = SP.ClientContext.get_current(); var items = ...
1
vote
1answer
1k 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 ...
2
votes
0answers
26 views

Get distinct values via mechanism used when clicking “Show Filter Choices” on a Sharepoint list using Javascript

As many other people on this site seem to need, I'd like to get an array (or equivalent) of the distinct values in a field for a list. The canonical way of doing this is to retrieve the entire field ...
0
votes
1answer
58 views

Add item to list using button

I try to create button that will be add item to the list. Unfortunately I do somethings wrong. My programming skill's are at beginner level. I have list "List" with only one field Title (for test) - ...
3
votes
1answer
33 views

Is it safe to use Reflection against SharePoint 2010/2013 Client object model to read Private variable in .net?

During some Read/Write/Update operations SharePoint Client Object model returns '(503) Service Unavailable' exception, reattempt solve this problem. Here, re-attempt Operation creates a new collection ...
0
votes
2answers
71 views

Unable to get property 'get_current' of undefined or null reference

$(document).ready(function () { var count = 0; retrieveCurrentListProperties(); function retrieveCurrentListProperties() { clientContext = new ...
0
votes
0answers
23 views

Find termsetid by term name in Sharepoint 2010

i want to retrieve termsetid in console application using client object mode. because i want to create metadata site column using client object model but i need termsetid to create id. how to get this ...
1
vote
2answers
391 views

SaveBinaryDirect Throws Unauthorized When the Client Object Model Works fine

I have decided to use the SaveBinaryDirect Method to upload documents to the sharepoint site due to not having the request/file size limitations that the client object model has. The application does ...
0
votes
1answer
35 views

JSOM CSOM query only get dates that are not passed todays date

I have a list which contains an end date, I want to query this list and only collect the items which end date have not passed todays date. Once this has happened I want to count the new queried table. ...
8
votes
4answers
2k views

How to add list web part to the SharePoint page using Managed Client Object Model?

I am trying to add new web part to the SharePoint page using Managed Client Object Model that will display a list. I can't seem to be able to figure out the code of the web part's XML that is ...
0
votes
1answer
509 views

Client Object Model

I am using the .NET Client Object Model from a website to access data in a SharePoint list. One of the fields I am trying to access is a lookup field. How do I get the text for the lookup field using ...
0
votes
1answer
432 views

SPServices - GetRolesAndPermissionsForCurrentUser

I have a list where one group of users is not allowed to delete items but they have view and edit permissions. All items in the list contain an attachment. However, users are not allowed to delete the ...
1
vote
2answers
385 views

Control JavaScript with Ribbon Button

my aim is to add a Ribbon Button which is opening a printing dialog for a selected file in a document library. I already added the Button with SP Designer and linked it with a html file which is ...
1
vote
1answer
47 views

How to stop execution after exception in ExecuteQuery

I have a remote event receiver attached to a list on my SP web and code that then runs on the ItemUpdated event: var web = clientContext.Web; var site = clientContext.Site; var list = ...
3
votes
2answers
866 views

SP 2010 - Client object model (javascript) - How to use get_listItemCollectionPosition for paging?

This is my code: When I call the function to get the items, it fails (doesn't go to the fail function, it goes into the success function but crashes when I try to get the position object), and I get ...
1
vote
1answer
843 views

Convert Image src to base64

I am working on Sharepoint 2010, I have create one custom button. when user select any row from list and click on custom button then I have fetch one multiple line column html in one variable name ...
0
votes
1answer
2k views

Setting file Content Type using Client Objects

Setting the Content type the same way as setting other metadata fields does not work in ClientObjects. Anybody knows why? Here is what I do, and works for other columns: var fci = new ...
5
votes
2answers
3k views

moveTo and moving documents from one library to another

I have followed and successfully implemented the excellent article: SharePoint 2010 ECMAscript – Copy\Move files to another document library – Part 2 located at: ...
1
vote
1answer
644 views

How to apply CAML in SharePoint view

I'm using SharePoint client object model and trying to query specific view but not getting the correct method to do so. Here is my code, using SP = Microsoft.SharePoint.Client; using ...
0
votes
1answer
5k views

How to reterive list item values using CAML query?

I have one Date and time column and text colum. I need to retrieve list item value based on this both column using CAML query.. For ex: Columname---> Date value for date would be-6/1/2013 and ...
2
votes
2answers
391 views

When using Sharepoint Client Model I get error : The 'Contains' member cannot be used in the expression

When using 'Contains' in Linq query: var camlQuery = new CamlQuery(); var listItems = list.GetItems(camlQuery); var itemQuery = listItems.Where(i => ...
5
votes
2answers
5k views

Get list by Internal Name using ECMAScript / JavaScript Object Model

How can I load items from a list using its InternalName? As far as I know I can get it using either Id or Title like the following: var clientContext = new SP.ClientContext('/News/'); var web = ...
2
votes
3answers
86 views

Need a way to identify files which have no checked in version

I wrote a script that traverses a collection, it's document libraries and gets a list of all files. I'm trying to find all the documents which do not have a checked in version and require a user to go ...
0
votes
0answers
36 views

using SharePoint COM to update list from csv file

Using SharePoint COM (using C#) I am trying to update my custom list from a CSV. In both the list and CSV file on column is common and I using that column for comparision. I am able to achieve the ...
1
vote
1answer
438 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 ...
2
votes
1answer
395 views

Accessing files in SharePoint AutoHosted App 2013

I am creating an AutoHosted App in SP 2013 and trying to access the file under one folder of remote Web ( need to pick the file from current project directory location and pass that file to another ...
2
votes
2answers
1k views

Unable to get correct element on a sharepoint page using document.getelementbyid('<%textboxID.ClientID%>')

I have a sharepoint website which has multiple instances of the same visual webpart. On button click I am trying to get a textbox present in the usercontrol of the webpart using ...
1
vote
1answer
60 views

How to access the data from Manage User Profiles?

We are have sync the SP with AD using Active Directory Import for SharePoint 2013. All the users have been picked up into the Manage User Profiles and new user properties have been added to the ...