Questions tagged [client-object-model]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
512 views

Windows Application to access the list in a Sharepoint Site using Client Object Model

I have created a Windows Application, which uses Client object model to access lists in a Sharepoint site(installed and configured on a separate server). I have used the default credentials to access ...
1
vote
1answer
481 views

How to add attachment to new item silverlight client object model

I am trying to add an attachment to new item but I could only succeded to upload the attachment into the list's folder (not to list's attachment folder). How can I achieve uploading the attachment on ...
3
votes
1answer
3k views

How to upload a file larger than 2MB to SharePoint document library using Managed Client Object Model for Silverlight

I can't seem to upload a file to SharePoint if that file exceeds 2MB or so. I am developing a Silverlight application that is interacting with SharePoint via Managed Client Object Model for ...
1
vote
1answer
1k views

How to cancel pending actions in Client Context? (Managed Client Object Model)

I have written a code relying on Managed Client Object Model which performs the following actions: Creates a site Web site Creates a list List list1 Creates a list field FieldText field1 (which is a ...
4
votes
2answers
239 views

Is there a way to determine if the SharePoint version is 2007 or 2010 using Managed Client Object Model?

I am building an application that interacts with SharePoint 2010. It is a Silverlight application built on the Managed Client Object Model. The application is set up on SharePoint like this: User ...
2
votes
2answers
2k views

Get list of web parts on the client-side

Is it possible to use the Client Object Model or jQuery to get a list of the SharePoint 2010 web parts on a certain part of the page, say those in the DIV #main-content? To be more specific, I'd like ...
1
vote
1answer
1k views

Cannot cast to clientContext.CastTo<T> (Managed Client Object Model)

I am writing a method that is supposed to create a SharePoint list field. I want to be able to make my method return the newly created field. The problem that I am facing is that list.Fields....
0
votes
1answer
165 views

Access different site collection using client OM

I have written a little app, which makes use of the ECMA client OM. I need to access from a site-collection "/sites/subsite" a list, which is located on the site-collection "/". However, this shows a ...
2
votes
2answers
4k views

How to add new item in Links list using Managed Client Object Model?

I have created a standard SharePoint Links list, using Managed Client Object Model (for Silverlight). Here's the code: ClientContext clientContext = new ClientContext(sitePath); clientContext.Load(...
3
votes
1answer
5k views

How do I save files that are larger than 1MB using the Client Object Model?

I'm trying to save a file to an SP document library using the Client Object Model: //populate information about the new file, from disk FileCreationInformation fci = new FileCreationInformation(); ...
1
vote
1answer
6k views

Setting User column value via Client Object Model

I'm trying and failing to set the value of a User column via the SharePoint client model: int userID; string displayName; /* Look up userID and displayName from Web Service here */ Microsoft....
2
votes
1answer
878 views

How can I access the Taxonomy store using the Client Object Model?

We are writing an Outlook plugin and need to create an overview of the available Managed Metadata term stores and terms from clients that connect to SharePoint. I have used the TaxonomySession to do ...
2
votes
1answer
415 views

Access My Content using ecmascript client OM

Is is possible to access the current user's "My site" and "My Content" using the ecmascript client OM? Specifically I'm looking to create a custom list, that is specific to each user, and wanted to ...
0
votes
1answer
1k views

Using the Sharepoint Client Object Model with ASP.NET C# page

So why when I add the line <%@ Import Namespace="Microsoft.Sharepoint" %> does the page error with: An error occurred during the compilation of the requested file, or one of its dependencies. ...
5
votes
4answers
16k views

Closing a modal dialog using a custom form

I am using some JavaScript (Client OM) code to open a dialog. Here's a snippet: function OpenModalForm() { //snip var opt = { url: url, width: 800, height: 600, ...
0
votes
1answer
9k views

Internal Server Error (500) using Managed Client Object Model

I'm attempting my first foray into the Client Object Model. In the following code, using (ClientContext context = new ClientContext(url)) // url works w- SPSite { Web web = context.Web; ...
0
votes
1answer
2k views

Setting a Publishing Hyperlink Field Value that has no Value

I am using the Object Model and the Microsoft.SharePoint.Publishing.Fields.LinkFieldValue namespace in an attempt to set the value of a Hyperlink Column on a SharePoint 2007 Publishing Site. However,...
1
vote
1answer
103 views

Is it possible to use the Javasciprt client object model from a different web server?

Basically I would like to host an application on a different server than my SharePoint server. Using the managed client object model I have been able to access data on my SharePoint server, but I'm ...
2
votes
1answer
2k views

Client object model thread safety

Is ClientContext thread-safe? I'm using Parallel framework to parallelize some work that creates new items on the list. Example: using(var ctx = new ClientContext(siteUrl)) { var list = ctx.Web....
1
vote
1answer
3k views

Can't add item using client object model of sharepoint 2010 with read only permission to user

I have already developed Silverlight application in SharePoint 2010 using client object model. But I have one scenario that user can comment on the item, so there is a update operation come in ...
7
votes
1answer
612 views

structure of sharepoint javascript functions

I am trying to understand more the structure of javascript functions in SharePoint. Why does every function begin with som value than colon and semicolon like ULSrE8:; in spgridview.debug.js: ...
2
votes
3answers
717 views

Getting item id after inserting with Javascript Client OM

Is it possible to get the inserted item id after executeQueryAsync? Or do I have to send a second query to get the item id?
0
votes
1answer
716 views

Building a Floating Menu for SP 2010

I would like to have a floating menu the menu can come from a list or use the Quick launch. Any ideas or samples out there.. For example if i can make this float http://clarklab.net/blog/articles/...
2
votes
1answer
76 views

Silverlight application privileges

I have a silverlight application which uses the client object model to access the sharepoint server. When i run the app "out-of-browser" with elevated trust everything works great, but when i try it ...
1
vote
1answer
1k views

SP2010 Client Object Model 3 MB limit - updating maxReceivedMessageSize doesnt get applied

I am using Client Object Model to interact with Sharepoint 2010. When I tried to upload documents greater than 3 MB using Client OM, it gave an error Bad Request. Microsoft suggests this to fix the ...
4
votes
3answers
5k views

Uploading file version - Client Object Model

I have a library with versioned files. I have versioned files prepared for uploading (1 version = 1 file). How do I create new version? Do I just set file's Content property and Update it? Please ...
4
votes
1answer
4k views

Enable versioning Document Library

i am trying to enable versioning on a ducument library using the client object model my code currently is as follows when i create the document library. ClientContext clientContext = ...
4
votes
2answers
7k views

Attach a Javascript function to an OOTB ribbon button

I want to attach a custom javascript function to the out of the box "Download a copy" ribbon button. This is to provide analytics for file downloads done through the ribbon button. I tried this code,...
2
votes
4answers
19k views

How to check if a folder exists in a list?

I have the following code: SPFolder oFolder = myList.RootFolder.SubFolders[folderName]; if (oFolder == null) { Console.WriteLine("FOLDER NOT FOUND"); ...
2
votes
2answers
649 views

Popup to allow emailing of current URL

I'd like to implement an email icon on the pages of our SharePoint 2010 site collection; when the user clicks it, a Lightbox-style popup allows the user to email the current URL with a custom message ...
0
votes
1answer
382 views

Wrong results returned with Sharepoint Client ObjectModel

I'm using the sharepoint client object model for a small application. When I try to get all folders and items from the "Shared Documents"-library, it doesn't return all folders and files. Code: ...
4
votes
1answer
5k views

How to find the Author Name using SP Client Context in SharePoint 2010?

I am trying to find the Author Name(created by) for a given Item Id using the SP Client context in SharePoint 2010. Below the code snippet var ctx = new SP.ClientContext.get_current(); //...
0
votes
1answer
2k views

Close SP.UI.ModalDialog on form submit

I am using the SP.UI.ModalDialog to popup a custom form. The form uses an XSL stylesheet that uses the GenFireServerEvent to commit the data. This works correctly, but I want to close the popup once ...
1
vote
1answer
2k views

How to Union 2 Lists Using ClientContext?

I have 2 lists which both contain identically-named fields that I'm trying to access using C#. Using ClientContext, how can I perform something that does the same thing as a SQL Union to give me one ...
0
votes
1answer
128 views

Proper way to retrieve list data asynchronously?

I have done this in the past using jQuery's ajax function and the SharePoint web services, but I'm curious if it is considered a better practice to use the Javascript Object Model? Also, is it secure ...
2
votes
2answers
10k views

How do I get the number of items in a list?

I have a list with a lot of items in it I need to know the list item count the following is my code: var sListId = SP.ListOperation.Selection.getSelectedList(); var oWeb = item_clientContext.get_web()...
1
vote
2answers
932 views

No return from asynchronous query

I am unable to retrieve objects using the ClientContext.ExecuteQueryAsync method. Originally I was attempting to obtain a list item, but figured out that wasn't happening because I didn't really have ...
0
votes
1answer
264 views

accessing wssid and the guid of managed meta data using silverlight

I am making a silverlight UI to allow users to enter information into a list. I want give the users a choice of metadata to enter into the list, but in order to enter the metadata into the list, I ...
0
votes
1answer
702 views

Albums and images from Photo Gallery with Client Object Model

I have a photo gallery library. I want to get all albums and their images. Now I get all albums (root level items) with something like this: ClientContext ctx = new ClientContext(_url); _mylib = web....
5
votes
2answers
1k views

Client Object Model Authentication - Authenticating the Wrong account!

I am using the Client Object Model to interface my .NET App with SP 2010. What I am finding curious is that I am using default authentication, and whenever I make my connection, I am ending up ...
0
votes
1answer
3k views

SharePoint 2010 - enable custom ribbon button only if user has permission to edit selected item

I have a custom action in a ribbon, and I need to enable the button only if current user has permission to edit the item (Contribute role). The action is defined in a document library, the way it ...
0
votes
1answer
1k views

Refreshing a document library using the client side UI in 2010

After adding a document to a sharepoint document library from an SPModalDialog, how can I refresh the underlying list using the new 2010 client object model in SharePoint?
0
votes
2answers
3k views

How to read from a list using Silverlight and the SharePoint 2010 Client Object Model?

I am attempting to write a simple Silverlight webpart that reads information from a list and then outputs it to a data grid. I can get all of the lists, their titles and their field titles fine but ...
1
vote
1answer
161 views

Client Object Model and 32 bit

While trying out Client Object Model, I was wondering whether will there be any issues if the 'Platform Target' is NOT set to 64 bit? I tried setting the value to 32 bit, even then the application was ...
0
votes
1answer
467 views

Is there a way to get the currently logged user’s colleague list using ECMA client script?

Is there a way to get the currently logged user’s colleague list using ECMA client script? Used the below script to pull the currently logged user name: <script type="text/...
0
votes
1answer
394 views

Using Client OM from an Windows Auth ASP.Net application

I have an asp.net application and a SharePoint application which uses windows authentication and are on the same domain. From the asp.net application, I am making some managed client OM calls to the ...
5
votes
2answers
3k views

How to disable a ribbon button when a folder is selected

I have added a new button to the SharePoint ribbon for document libraries. This all works well and the button is enabled / disabled depending on the number of items selected... fine! I want to ...
3
votes
1answer
1k views

People Picker control for Silverlight, or alternatives?

This is probably a longshot, but does anyone know of a way to resolve a name entered in a Silverlight textbox to a SharePoint User object in Silverlight, using the client object model? Ideally, I'd ...
4
votes
2answers
6k views

Changing the SP.UI.Notify notification color

Does anybody know how to change the color of the notification popup displayed by the SharePoint 2010 client object model for Javascript? The following always gives me a green popup: SP.UI.Notify....
3
votes
2answers
2k views

Can I use the SharePoint 2010 Client Object Model with Sharepoint 2007?

Any workarounds or alternatives that work on both SP2010 & 2007. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b4579045-b183-4ed4-bf61-dc2f0deabe47