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

learn more… | top users | synonyms (1)

1
vote
3answers
901 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 = ...
0
votes
1answer
544 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 ...
8
votes
1answer
3k views

How to Impersonate Users Via Client Object Model?

I want to insert new SP List items -- blog comments, to be exact -- on behalf of other users. Ideally, I'd just pass a SharepointID for the user, but that doesn't seem to be possible. I think that ...
4
votes
4answers
9k 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
659 views

Slow running Managed Client Object Model application

I have an application that I built using the Managed Client Object model that performaing poorly and I am curious if I am doing something wrong. The application drills down throw a hierarchy of three ...
3
votes
1answer
3k 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(); ...
7
votes
1answer
3k views

How to get a list of all Choice field options using Client Object Model

How would you get a list of all the possible choices from a choice field (e.g. Task list Priority or Status fields) using javascript client object model?
0
votes
1answer
1k 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. ...
2
votes
1answer
1k 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 ...
7
votes
3answers
10k views

How can I use the SharePoint Javascript Object Model from a plain HTML page?

I would like to use the SharePoint Javascript Object Model from a "plain" html page (ie, not an .aspx application page etc.) Is this even possible? If so, what scripts should I reference? I've added ...
1
vote
1answer
79 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
403 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 = ...
0
votes
1answer
153 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 ...
5
votes
1answer
466 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: ...
1
vote
1answer
3k 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 */ ...
2
votes
1answer
71 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 ...
2
votes
1answer
503 views

ClientRuntimeContext to ClientContext

I was wondering if their is any way to convert ClientRuntimeContext into ClientContext. i am retrieving the ClientRuntime context like this public File uploadBase(Document document, Folder ...
0
votes
1answer
485 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 ...
2
votes
1answer
888 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
3k 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 ...
1
vote
1answer
909 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 ...
2
votes
2answers
512 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 ...
1
vote
1answer
748 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
4answers
6k 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"); ...
3
votes
1answer
712 views

Permissions error in IE 8 but not Firefox 6.0.2?

I am using the Javascript Client Object model to access some information from a list. Below is the code I am using: function getDeptInfo(id) { //var value = ...
0
votes
2answers
960 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 ...
5
votes
1answer
2k views

Fetch list of sites in site collection into jQuery

Is there a way to get the list of sites in the current site collection into jQuery as an array or other data structure? Thanks.
7
votes
1answer
3k views

Get a value included from a lookup column using the JavaScript Client Object Model

Related: How to retrieve a ListItem using the Javascript Client Object Model? In my previous question I was able to successfully retrieve a basic value from a list item. My problem is that I am now ...
0
votes
1answer
1k 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 ...
2
votes
3answers
459 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?
1
vote
1answer
7k views

How to retrieve a ListItem using the Javascript Client Object Model?

Right now I am using this method: function getWebProperties(id) { var ctx = new SP.ClientContext.get_current(); this.website = ctx.get_web(); this.listCollection = website.get_lists(); ...
0
votes
1answer
114 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 ...
1
vote
1answer
673 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 ...
4
votes
2answers
6k views

How to retrieve lookup values using ClientContext?

What's the best way to retrieve lookup values using ClientContext? I'm accessing a list using ClientContext (let's call it ParentList). That list contains several lookup fields (let's call one of them ...
2
votes
2answers
4k 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 = ...
2
votes
3answers
5k views

How to get list by url using client object model?

Is it possible to get list by url using ECMA script client model? For example something like this: context.get_web().get_lists().getByUrl("Lists/MyList");
1
vote
1answer
731 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 ...
12
votes
3answers
2k views

Client Object Model equivalent of SPUtility.SendEmail in SharePoint 2010

I am trying to send an email after an action occurs in Silverlight WebPart I am designing. Is there a built-in class in the Client Object Model that can handle this, or will I have to build a ...
0
votes
1answer
339 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: ...
0
votes
1answer
2k 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 ...
2
votes
2answers
3k views

Error on sp.js property 'isNullOrUndefined'?

When I try to run my javascript SP.JS file in a user control I get this error: Microsoft JScript runtime error: Unable to get value of the property 'isNullOrUndefined': object is null or undefined ...
1
vote
3answers
2k views

Missing fields from SiteUserInfoList user ListItems

I'm using the SharePoint 2010 Client Object Model to retrieve all the users from a SharePoint instance, via Web.SiteUserInfoList: var query = new CamlQuery { ViewXml = "<Query/>" }; var ...
1
vote
3answers
993 views

401 with ClientContext

I am connecting to SharePoint via managed client api. ClientContext connects to the site and access the list data when I specify the site address as http://computer_name but when I give the configured ...
1
vote
1answer
340 views

Help with Silverlight and SharePoint

As a continuation of my last question, I can get the data correctly now just I am having a problem getting it to display. I want it to be in a DataForm control but I seem to be unable to connect it ...
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 ...
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 ...
1
vote
1answer
132 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
433 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 ...
0
votes
1answer
270 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 ...
1
vote
2answers
262 views

External Data: Better to Import into SP Lists or Access Externally?

I have been tasked with creating a report in Sharepoint to display data compiled from multiple external databases. From my experience thus far it seems that a Visual WebPart is the way to go to ...