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

learn more… | top users | synonyms (1)

2
votes
2answers
2k views

SharePoint Client Object Model Assembly Distribution

I would like to know if it is illegal (against MS licensing agreement) to: Copy the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies from a SPF 2010 server to TFS ...
1
vote
1answer
306 views

Sharepoint managed client object model - Updating Eventdate in calender

I am using managed client object model in sharepoint and I am adding EventDate and on adding that I am catching exception which says Microsoft.SharePoint.SPFieldValueException if ...
2
votes
1answer
2k views

Delete item from Client Object Model

I'm trying to delete an Item from a list using the following code: using System; using Microsoft.SharePoint.Client; using SP = Microsoft.SharePoint.Client; namespace ...
1
vote
1answer
1k views

Create new Document in Document library with additional Text Fields in Silverlight (Client Object Model)

I have created a Silverlight Application that runs in a SharePoint 2010 web part. One requirement I have is to give the user a prompt to upload a file, and then send it into a specific Document ...
2
votes
1answer
692 views

Managed Client Object Model NavigationNode Url Property Incomplete

It seems the Client Object Model is stripping out the "query" part of a URL stored inside the NavigationNode elements. I am wondering if this is a bug or perhaps I am doing something wrong? Consider ...
1
vote
2answers
1k views

Is <QueryOptions> valid in SP.CamlQuery for meeting work space

I'm trying to query all items in a meeting workspace list. I'm trying a query I think should work, but still only returns items specific to the instanceID. Is there a different flavor for client side ...
1
vote
2answers
5k views

What arguments can I pass to NewForm.aspx using SP.UI.ModalDialog.showModalDialog(options)?

I'd like to create a task with a pre-filled title, as well as set some other properties. I found this documentation that says I can pass arguments when i call ...
3
votes
3answers
8k views

Get User via JavaScript Client Object Model

Is there a way to get user information via the JavaScript Client OM? Something similar to the clientContext.Web.EnsureUser(userName) method. I am aware that there is the SPService JQuery library, but ...
0
votes
1answer
4k views

Error Running ExecuteOrDelayUntilScriptLoaded

Using IE9 (9.0.8112.16421) I receive the following error in the debugger while running the script I'm working on: "Unable to get value of the property 'toLowerCase': object is null or undefined" ...
0
votes
3answers
218 views

Display external data in SharePoint-style lists style using the Javascript Object Model

I have a webservice which provides me with tabular data, which I would like to display in SharePoint in the typical SharePoint-List way. Now I could simple copy the html and styles and build the ...
1
vote
0answers
44 views

How do I get count of list item collection items with javascript? [duplicate]

Possible Duplicate: Getting a count of list items in a list via ECMAScript I found something, it works, but it's not nice. var items; ... var enumerator = items.getEnumerator(); var count = ...
2
votes
1answer
921 views

Create/Extend new Ribbon with the client OM

I want to integrate an existing LOB application into SharePoint using JavaScript. To give the user a single user-experience, I would like to add an application specific ribbon to the current page. ...
0
votes
2answers
583 views

Is it possible for ECMAScript to manipulate a library?

I'm trying to write a script using the Client Object Model that searches for information from a document library, but I'm having no luck. However, using the same script with a couple of variables ...
5
votes
4answers
7k views

Get current web url in a SPRibbon Custom Action Command

I've a SPRibbon custom action with the purpose of open an custom app page in a modal dialog, but I'm getting troubles for getting the current web URL, as well, set a reference for a .js with the right ...
2
votes
1answer
447 views

How can I use SP.UI.Notify or jQuery to show real time messages in SharePoint?

I would like to use SP.UI.Notify or jQuery in SharePoint 2010 to display messages when a new document is added or a new item is posted. So if the users are on the page I just want the message to ...
1
vote
1answer
526 views

How to access AssignedTo in JavaScript Client Object Model

I have a task list that has a field AssigneTo which takes a user via the people picker. I can get the list item I need but I have no idea how I would access the oject being returned for the AssignedTo ...
1
vote
1answer
2k views

Creating a new ContentType with Document as base using Client Object Model

It would appear that the Client Object Model only retrieves user-defined content types as part of the ContentTypes property for a given web. I would like to create a new content type using Document as ...
2
votes
2answers
4k views

Performance of Client Object Model vs. Server Object Model

We are looking to deploy an Intranet using SharePoint Foundation. I am targeting the Client Object Model for this project to avoid Master Page customization and building custom Webparts and leverage ...
4
votes
4answers
17k views

Get Items Under Folder CAML

I am trying to retrive all items that are under a certin folder, in a document library. this is what i have so far List DocumentsList = clientContext.Web.Lists.GetByTitle(list); CamlQuery camlQuery ...
7
votes
1answer
817 views

Client Object Model SystemUpdate

I need to have the SystemUpdate functionality from the Client Object Model. Is there any way I can do it since the ListItem.SystemUpdate() does not exist? Another solution would be to disable the ...
0
votes
1answer
1k views

How to add SPUser to sharepoint list field (lookup)

I have a sharepoint list, with a lookupfield for users. The column name is "SystemUser". I have successfully added a listitem by using javascript, setting the "SystemUser" to the current user by ...
5
votes
3answers
10k views

Cannot get field value of list item through JavaScript

I try to get the value of a list item (that is currently selected). I know that I must load it into the context but even with loading the field explicitly I get the following message. Microsoft ...
7
votes
1answer
2k views

Create a Document Library Item base on a ContentType with JavaScript Object Model (JSOM)

I'm trying to create a new item in my Entreprise Wiki Pages Document Library. It's associated with a News Content type. I was able to retrieve the SP.List object (myList), the SP.ContentType object ...
1
vote
1answer
722 views

Client Object Model - document library icons

I'm using client object model in a custom webpart. What I'm looking for is a way to get the file-icons that represent the doc types of the files in a document library. Probably I need a solution ...
2
votes
2answers
333 views

Clear list data from code

I need to clear the data contained in a list programmatically. I know I can iterate through every single item to delete it, but that takes forever. Any suggestion? (I'm with the client object ...
6
votes
4answers
10k views

Javascript to display sharepoint list items on page load

With Client Object Model API and a bit of javascript, I want to retrieve the items of a sharepoint list and display them into the web page, when the web page loads. I've successfully implemented ...
6
votes
1answer
2k views

Context Menus - Send To not working in IE9

I have a document center with a custom master page. The page is designed with IE9/HTML5/CSS3 in mind. In my other question, I worked out how to fix the IM Presence icons by fixing some core ...
5
votes
2answers
4k views

SharePoint 2010 ClientObjectModel : Find Item by GUID

I have a list of 6000 listitem GUIDs. I need to check if each item still exist on the Web. Previously, I was using the SPWeb.GetFile(GUID) method to check the item. But now I need to convert that ...
9
votes
3answers
14k views

How to get all items in a View using Client Object Model (JavaScript)

To get all the items in a List you use // Setup context & load web context = new SP.ClientContext.get_current(); web = context.get_web(); context.load(web); // Load task list this.List = ...
3
votes
2answers
1k views

Stop deletes via EditForm.aspx using SP.UI.ModalDialog.showModalDialog going to List view page

If you use SP.UI.ModalDialog.showModalDialog to show a Lists standard EditForm.aspx the callback (dialogReturnCallback) is hit for cancels and edits but not deletes which are instead redirected to the ...
4
votes
2answers
2k views

How to get the ID of the list item just inserted using SP.UI.ModalDialog.showModalDialog

If I am using JavaScript Client Object Model and SP.UI.ModalDialog.showModalDialog to display a form to enter a new list item, how can I get the ID of that item after its been added? Example ...
3
votes
1answer
1k views

Client Object Model - retrieve lookup item in same ExecuteQueryAsync?

What I like in SharePoint Client Object model is that you can make batch queries. What I cannot find is if it's possible to get related items (linked by lookup field) in the same query? An example ...
1
vote
3answers
678 views

How do I list all masterpages using client object model

I want to get all masterpages in client object model. For classic lists and libraries, I use context.Web.Lists.GetByTitle(listname) How do I do that to get the masterpage list ...
4
votes
2answers
2k views

How to read a column type SPUser, DateTime, Currency with EcmaScript?

I have a list in SharePoint 2010 with some columns. All are default types. So I have "Single line of text" "Multiple line of text" "Date and Time" "Choice" "Number" "Currency" "Person or Group" ...
3
votes
1answer
5k views

How to programmatically retrieve item version history from client?

Using server-side code I can access List Item version history using SPListItem.Versions. Is there a way to programmatically access the same information from the client? I am happy to use either the ...
6
votes
2answers
2k views

How to retrieve distinct values with JavaScript Client Object Model

How can you get distinct values from a SharePoint List column using JavaScript without a huge performance hit? A simple example would be appreciated :)
1
vote
2answers
7k views

How do get selected item of list?

I have a webpart .I add a listviewbyquary in createchildcontrols and a hyperlink in visualwebpart. i use this http://graegert.com/featured/using-the-editorpart-to-create-a-custom-listview-web-part ...
0
votes
1answer
658 views

Get sub site path with Client object model (Silverlight)

I'm currently building a Silverlight web part on SharePoint 2010. The issue I have, maybe is too trivial for me, is that I have a list, lets say its ...
7
votes
1answer
540 views

JavaScript Client Object Model functionality to get all the non hidden lists of current web and listing them

We have requirement to get all the non hidden lists of current web using JavaScript Client Object Model(JSOM). I have tried the below code but failed to get the desired result. function ...
6
votes
2answers
7k 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 = ...
4
votes
1answer
8k views

How to get all fields of a list using JS Client Object Model

Is it possible to retrieve all fields of a list (or default view) through the JavaScript Client Object Model and filter the fields on type (e.g. I only want the Choice fields). var clientContext ...
0
votes
2answers
256 views

Client object model always returns 0 items from list

I am running a very simple Console Application to test SharePoint 2010 client object model. Here is the code using System; using Microsoft.SharePoint.Client; class Program { static void Main() ...
13
votes
5answers
4k views

WebServices or Client object model?

I am writing a Silverlight control which will display the data from SharePoint list for use in SharePoint 2010 site. I am considering wheather to use Client Object Model or SharePoint web services ...
1
vote
1answer
259 views

Error while downloading Lists in a spweb

Here is the code private void downloadList(SPObjectData objectData) { using (SPWeb currentWeb = objectData.Web) { foreach (SPList list in currentWeb.Lists) ...
1
vote
1answer
126 views

Cannot create site in different web application - Silverlight Client Object Model

I am developing a Silverlight application. It interacts with SharePoint 2010 using SharePoint Silverlight Managed Client Object Model. One of the application functionalities is to create a ...
1
vote
3answers
2k views

ClientContext cannot contact site at specified url

Im doing a simple connection to a sharepoint 2010 site using clientcontext and im getting the error "cannot contact site at specified url". The site (eg Site1) is a host-header site it was ...
2
votes
1answer
3k views

JavaScript object model - using executeQueryAsync with body.onbeforeunload

I am trying to write some code that updates a list item when a list edit form (EditForm.aspx) opens and closes. I have written a function and assigned it to the onload and onbeforeunload events of ...
1
vote
1answer
576 views

Add numbering to a standard list view

We're displaying a SharePoint 2010 list using a Standard View created via the browser. The items are shown in a table and the users would like a number shown for each row. The numbers column would be ...
1
vote
2answers
689 views

Getting the error “The underlying connection was closed: An unexpected error occurred on a receive.” using Client Object Model

I'm trying to connect to a SharePoint 2010 site using the .NET Client Object Model. When I run test code from a windows console app that I have written, I have no problems. When I try to run the same ...
3
votes
2answers
2k views

Getting the GUID of a file with client object model?

Is it possible to get the GUID if I have the path to a file? Any sample code available?