Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
2k views

How to Client Side connect to Sharepoint 2010 with claim based auth

I had to create an application which connects to Sharepoint. The interested Sharepoint Application is set to work ONLY with claim based Authentication, so I cannot use the classic: NetworkCredential ...
4
votes
2answers
7k 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?
2
votes
2answers
930 views

Does Managed Client object model work for Cross Domain?

I want to know whether managed client object model works in cross domain cases. For example I have a console application in Domain A, can I use managed client object model in the console application ...
0
votes
1answer
211 views

Change order of user profile property

Hi i want to change the order of user profile property in a subtype i found out this link SharePoint 2010 - Change order of User Profile properties which is changing only in default sub type but its ...
3
votes
2answers
6k views

HTML from Rich Text Field as Plain Text

First off I want to be clear I am using the Silverlight Client Side Object Model in solution. So I cannot use objects/properties from the server object model. What I am trying to do is get the plain ...
4
votes
1answer
687 views

AddLookup using the client object model?

Trying (desperately) to find the Microsoft.Sharepoint.Client equivalent of SPList.Fields.Addlookup My code: ClientContext ctx = new ClientContext("http://sharepoint/"); Web website = ctx.Web; ...
0
votes
2answers
5k views

Uploading a Word Document to Sharepoint using SaveBinaryDirect() resulting in corrupted document

I am uploading a document to sharepoint site using client object model. using (FileStream fs = new FileStream(@"C:\temp\UlDoc.docx", FileMode.Open)) { File.SaveBinaryDirect(_cc, "/demo/Word%...
0
votes
1answer
153 views

Disable windows auth, but access a resource in the site collection

I have a sitecol with anonymous access. I have a console code that uses client-object-model to query from a particular list in that site collection. This was working fine. But recently I had to ...
3
votes
1answer
564 views

Client Side vs Server Side Querying: When to use each?

Relatively new to developing for Sharepoint, but building a website with a lot of functionality. The frontpage alone is making 5 queries to separate lists and has numerous javascript libraries ...
1
vote
1answer
377 views

Working with client OM

I need to set currentUser to some item field in Client Object Model. How can I do it? I always use new SPFieldUserValue (//,//,//) in server code, but here..
1
vote
0answers
757 views

Get Permissions with client object model

i want to add a permission on a folder who's inside a document library with javascript/jquery/client object model. The problem i have is, its a custom permission level created when some feature is ...
0
votes
1answer
7k 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" ...
1
vote
2answers
5k views

CSOM Query on Hidden User Information List returning nothing

I'm trying to retrieve a user's profile picture from the hidden User Information List within Silverlight. I can't use the UserProfileService.asmx because I don't have the login name nor the GUID of ...
1
vote
1answer
3k views

HTTP 500, HTTP 401 errors when executing ExecuteQuery() on Client Object Model

I am using Client Object Model to access a document library on a VM SharePoint server where I do have 'FullControl' access to a Site & Site collection. The below code works on my SharePoint ...
0
votes
1answer
328 views

Missing eMail in SPUser

I have a small application that is making use of the SP-COM. I use the following code to get the current users email address: ctx = SP.ClientContext.get_current(); web = ctx.get_site().get_rootWeb(); ...
1
vote
3answers
500 views

How to access documents with in a custom content type of Document Set

I have a Library, which stores document sets (the content type here is a documentset which contains more than one word document). Currently I can to get the items from the library using the below code ...
2
votes
1answer
537 views

Performance bottleneck on SharePoint upload method

Trying to eliminate a performance bottleneck on a method doing file and metadata uploads. According to the profiler on a line-by-line of the decompiled code, the majority of time is spent on context....
1
vote
1answer
665 views

How strictly is Client Object Model functionality Security Trimmed & Person (User) object resolution?

I have a Silverlight Webpart Application running on a Sharepoint2010 Page. The purpose of this webpart is to take a spread of different sections of data and condense it into a more easily usable form. ...
0
votes
1answer
836 views

Caml query returning multiple lists

Trying to load a list from library containing two files. The following code when tested in CamlBuilder it is returning single row according to the filename selected. But in the program it is returning ...
3
votes
2answers
5k views

Programmatically add Event to Sharepoint Calendar using Client OM

I need to programmatically add events to a SharePoint Calendar and make them repeatable using JavaScript Client Object Model (without any c# code). Does anybody have ideas how can I implement this ...
5
votes
1answer
11k 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 ...
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
1k 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. I'...
1
vote
0answers
71 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 = ...
0
votes
2answers
676 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
10k 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
748 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 ...
7
votes
1answer
3k 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
1k 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 ...
3
votes
1answer
3k 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
6k 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 ...
0
votes
1answer
2k 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 ...
3
votes
2answers
6k views

Using JavaScript Client OM gives error “ExecuteOrDelayUntilScriptLoaded was not defined”

I have: IN THE HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> ...
1
vote
1answer
1k 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
359 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 ...
5
votes
2answers
2k 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 ...
2
votes
1answer
2k views

How do I get a specific file using Client Object Model in Silverlight?

I can't seem to find any direction when trying to filter a FileCollection (Picture Library) by a specific value. I am 'trying' to use the Silverlight Client Object Model to access list data in ...
1
vote
1answer
136 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 ...
3
votes
1answer
2k 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
2k 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 (_catalogs/masterpage) ...
4
votes
2answers
3k 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" ...
1
vote
3answers
2k views

upload a file with metadata without creating a new version using the client object model

What I'm trying to do is upload a file with metadata without creating a new version using the client object model. I already have this code: byte[] bytes = System.IO.File.ReadAllBytes(@"D:\inor....
1
vote
1answer
1k views

UserMulti Field limit

Does UserMulti field have a limit on how much users are selected? I'm asking this because when I use client object model I can set at most 15 users at once. edit: I can add more users directly on ...
0
votes
1answer
716 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 http://www.mysite.com/subsite/anothersubsite/Lists/...
10
votes
1answer
949 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 ...
4
votes
1answer
23k 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 =...
1
vote
1answer
357 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) ...
2
votes
1answer
4k 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
787 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
1answer
319 views

How to access custom properties of a user in SharePoint client object model?

I have a set of users in my SharePoint site with a few custom properties like GUID, LOS, YOS etc. My application needs to access the user custom properties and do CRUD operations on the properties. I ...