API for interacting with SharePoint from .NET code deployed to the server.

learn more… | top users | synonyms

1
vote
2answers
282 views

SharePoint Data Modelling Tool

I plan to develop a data model for a SharePoint application that we would like to bid out for development. Is there a data modelling tool that is preferred to be used with SharePoint, like it can ...
1
vote
1answer
148 views

Stale QuickLaunch after SPWeb.Title update and Redirect

Thanks for taking a look. I have a text box and a button on a SharePoint aspx page which will update the current SPWeb's title. The control then redirects the user to a different .aspx page in the ...
0
votes
3answers
617 views

Accessing LookupFieldValue throws error

I have a lookup field on a list (header) that looks up values on the same list. I am trying to read the value out of that lookup with this code: using (SPSite site = new SPSite (mySite.ID)) { ...
2
votes
3answers
93 views

To Dispose or Not to Dispose - IDisposable Passed as Function Parameter

If an IDisposable SharePoint object is passed into a function, does an explicit Dispose() call need to be made on it? Example: public void TheCallingFunction() { SPSite site = ...
0
votes
2answers
347 views

How check if a site (not site collection) has sub sites in it? [Object Model]

I am trying to figure out a way to check if a Site inside a Site Collection has sub sites in it. To get sites inside a site collection, we can use the below code. foreach (SPWeb siteobject in ...
1
vote
1answer
39 views

Move discussion list to another discussion list

How to move a discussion list with all its messages to another discussion list maintaining the proper tree structure of the messages(replies)??
1
vote
0answers
195 views

Unable to seperate normal and hidden folder such as “Forms” [SPFolder Object Model ]

While performing certain task in a console application, i am unable to separate normal folder and hidden ones such as "Forms","FormServerTemplates" etc. I am using SPFolder in the obejct model. I have ...
0
votes
1answer
256 views

Getting Library contents along with Folder structure [Console application using Object Model]

I am developing a console application which will get all the files in a document library and copy it to a particular location on system. I was successful in retrieving all the files within the ...
4
votes
1answer
6k views

How to update a deployed content-type?

I created a content-type and applied it inside a document library. Now, if I go to the conent-type gallery and delete one of the fields, and then go back to the library and view the available ...
0
votes
0answers
309 views

SPListItemCollection.EnsureListItemsData seems to deadlock

I'm trying out multithreading with the SP2010 Object Model and I've run into some weirdness. My application currently does the following: Opens an SPSite and uses AllWebs.WebsInfo to build a Guid[] ...
1
vote
2answers
611 views

how to open version history using SPSecurityTrimmedControl

I am using SPSecurityTrimmedControl to view version history of list for users who have more than read permissions like this <.SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl1" ...
1
vote
3answers
435 views

I cant hide the Title field programatically

I am trying to hide the Title field so it does not appear in add/edit forms. I am using web templates. The title is hidden in the sitecollection but not in any of its sub sites. Below is my code. ...
0
votes
1answer
249 views

Enable-Feature powershell-command in object model

How to do Enable-SPFeature equievalent in object model. I want to enable some features (lists) in my publishing site in event receiver. For example: Enable-SPFeature announcementslist -url ...
0
votes
0answers
423 views

Cannot remove file <x>. Error Code: 16388

I've written a tool top copy/paste/delete files accross site collections and then remove the original version from the recycle bin. The method to copy the files is: public bool ...
1
vote
2answers
954 views

How do I obtain the SPWorkflow object in the event receiver?

I have a workflow event receiver which is handling the WorkflowStarted and WorkflowCompleted events. I need to obtain references to the workflow list item and the workflow object to do some additional ...
0
votes
2answers
159 views

How to update one list from another, element by element

I want update with some changes one list from another. The secand list should have details of first list. First list has got elements: Contract | Worker | Day Start | Day Stop | ...
0
votes
1answer
349 views

Sandboxed Solution to create a Document Library and enabling manual declartion as record

I need to create a SharePoint Feature, when activated needs to create a Document Library and then enable the manual declaration as record. Following is the code which is working fine in a Console ...
1
vote
1answer
74 views

Checking SharePoint Uptime Remotely

I was wondering how people have gone about programatically checking if SharePoint is still available? I use the following now to check it, but it relies on the SharePoint object model and must run on ...
0
votes
1answer
147 views

Invalid URI when trying to empty recycle bin

Based on this question I wrote the following in my class for emptying the recycle bin: public static void EmptyRecycleBinItem(string siteCollection, string originalLocation, string filename) { ...
1
vote
1answer
327 views

What permissions are required to access SPSite.Usage?

I am using the SPSite.Usage property in the object model to get statistics on the size of a site collection in SharePoint 2010. With my own user account being a farm administrator, site collection ...
2
votes
1answer
299 views

Is there a way to only clear a specific item from the recycle bin?

I know I can empty the recycle bin for a site collection with the following: public static bool EmptyRecycleBin(string siteCollection) { try { using ...
0
votes
1answer
171 views

PowerShell version of SPWebapplication.FormDigestSettings.Enabled?

Does some one know the PowerShell equivalent version of the following SharePoint object model code: SPWebapplication.FormDigestSettings.Enabled = false;
0
votes
1answer
2k views

Copying items from one list in one site to another in another site?

I have a class that I've been working on to allow me to move items in SharePoint, whilst retaining meta data. The class is as follows: public class Lists { /// <summary> /// ...
2
votes
1answer
106 views

Deleting a SharePoint User Profile remotely

Can anyone tell me how to delete a SharePoint user profile remotely? I don't see a way to do this using SharePoint Web Services or User Profile Services. The following code works fine when run on ...
0
votes
0answers
207 views

List item attachments not showing up when accessed through the object model

I've got some list items which have manually attached (through the web interface) files and need to access these files on server-side. Whenever I look at SPListItem.Attachments though, it always shows ...
1
vote
2answers
87 views

How to create sites taking values from database

In one interview, interviewer asked this question. I have one table in sql server database which contains the Title and its id(int). Now I want to retrieve those values from database and based on the ...
2
votes
2answers
2k views

Adding Document to a record library programmatically

I have a requirement, where I need to upload a document like invoice report to a record library programatic. I have used the same code as uploading document to a normal document library. Now the ...
0
votes
2answers
5k views

How to add specific SharePoint Group to List permission with c#?

using (SPSite site = (SPSite)properties.Feature.Parent) { using (SPWeb web = site.OpenWeb()) { if (web != null) { web.AllowUnsafeUpdates = true; SPList list = ...
0
votes
1answer
58 views

What is UpdateListCompleted and why isn't it documented?

I've been messing around with the SharePoint List web service and I came across an event called UpdateListCompleted. I thought this might be of some use for the project I am working on so I ...
0
votes
1answer
931 views

Need Sharepoint like modal pop-up window

I need to show Sharepoint 2010 like pop-up window when clicked on a link in grid view. Once the modal pop-up displayed and user selected the Save button data base should be updated with given values ...
0
votes
0answers
58 views

Save MasterPage to file system is not bringing Webpart data

I am saving some masterpages to the file systems in some build scripts to automate the process of building deployment packages. This is what I am using to save the masterpages and layouts: using ...
2
votes
1answer
168 views

Server side equivalent of this Client Object Model code?

I have the following javascript: SP.ListOperation.Selection.getSelectedItems(); And I'm wondering if there is a Server Side Object Model equivalent to this that I could use in Page Load? The ...
2
votes
1answer
93 views

Possible to use the object model to push content across two different web applications?

I've been able to use the object model to move list items between sites in the same site collection, but I'm wondering if I can use it to move list items between two different web applications on ...
0
votes
1answer
109 views

difference between non-/ shared scopes

can someone point out for me the difference between shared scopes and non-shared scopes? I think one difference is that shared scopes are available in all site-collections, whereas non-shared scopes ...
0
votes
1answer
601 views

Adding column in Status indicator

I have requirement that adding one more field in the Status indicator list view programmetically.is there way to extend the Staus indicator list using programmetically?.How can i acheive this? Any ...
5
votes
6answers
798 views

SharePoint 2007 : How to sign out user?

I've an application build on SharePoint 2007 platform, the problem is in Mozilla FireFox, the sign out button does not successfully sign out the current login user, I believe SharePoint 2007 is not ...
1
vote
1answer
167 views

What are “unsafe updates” for list items?

In the SharePoint 2010 server-side object model the SPWeb Class has a property "AllowUnsafeUpdates". What are unsafe updates in connection to list item changes? How are they to be delt with in code? ...
0
votes
1answer
105 views

Automatically add a folder (document set) by code (generating the name also by code, without the user inputting the name)

I want to know if it’s possible to write en Event Receiver in VB for automating the creation of a document set: the user only click “new document set” and then the code generates the document set with ...
4
votes
1answer
405 views

how to programetically get the type (TemplateType) of a Library using the item url

Imagine if you have image url which is existing within a site collection in Sitecollectionimages library: testserver/Sitecollectionimages/image.jpg How can I get the TemplateType (which kind of ...
-1
votes
1answer
40 views

Common XML file for a SharePoint farm enviroment

We have create a object model DLL and display some result on based upon XML file stored on physical disk on dev box its working fine. Issue with our production enviroment is that we have four server ...
7
votes
5answers
10k views

In which situation use SPSecurity.RunWithElevatedPrivileges with superusertoken?

i have given permission only read only to Users Group.so there are not access to see listitem or any list. i have create application page with SPGridview with bind listitem. this page access by this ...
1
vote
1answer
395 views

Dispose issue when working with content types

I am seeing an issue with un-disposed SPRequest objects in the ULS logs when i work with content types in the object model. My code is as follows (in previous methods run as part of this request, the ...
1
vote
1answer
102 views

What are the largest and smallest values that can be stored in an SPFieldDateTime?

What it says on the tin, basically! I assumed it's the same as a regular .NET DateTime struct, but whenever I try to store 01-Jan-0001 (smallest DateTime value), I get an error. Can't find it on MSDN ...
1
vote
1answer
462 views

Show Last Viewed date in a View

I understand enabling Auditing at a Content Type or Document Library level allows you to run reports to determine when documents are opened or downloaded (last viewed). Is there a way to show this ...
3
votes
2answers
1k views

How can I implement SharePoint JSGrid filtering and grouping functionality?

I am working on SharePoint JSGrid. I am able to implement the sort functionality in JSGrid. Now I want to implement the grouping and filtering in my custom JSGrid. For filtering we have to attached ...
4
votes
2answers
1k views

Is it possible to have a single document referenced by two different document libraries?

Business Requirements: My customer wants to be able to associate one document with multiple projects. E.g., a set of specifications for a piece of equipment that will be used in multiple projects. ...
0
votes
1answer
2k views

Getting SPUser object from “Group or People” SPListItem field

I am using a Powershell and CAML query to return items from a list. The list contains a "Group or People" field in which I have not seeing how to get the email and login information of the user. I ...
1
vote
3answers
7k views

How to convert string into SPUser?

I have a string "System Account", how can I convert the string into SPUser? I've tried SPContext.Current.Web.EnsureUser("System Account") and also web.AllUser["System Account"] but hit error. Please ...
3
votes
1answer
746 views

Using GetDataTable() hoses my SPFieldLookValueCollection!

I am trying to use GetDataTable on an SPListItemCollection. I have run into a situation where my SPFieldLookupValueCollections in this list are being converted to a string when they are stored in the ...
1
vote
2answers
947 views

Programmatically reading static links in the navigation

I'm having a SharePoint site where I disabled the "show pages" option in the navigation, and created my navigation using the add static heading/link option. My problem now is that I tried to ...