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

learn more… | top users | synonyms

1
vote
1answer
2k views

SharePoint 2010 - Change order of User Profile properties

I would like to know how to change the display order of the out of the box user profile properties using sharepoint object model ? I would like to move OOTB properties into my custom section.
11
votes
4answers
6k views

How to automate entry of external column data in BCS?

I have a document library, Resumes, that has a large number of resumes in it. There is a regular column on that library, called EmployeeID, that is already populated. I have an external content type ...
6
votes
3answers
21k views

Sharepoint 2010 how to get all items in a folder contained in a list?

I have a list that contains folders. Using c# and object model, how can I see if the folder contains any items, or return a collection of all the items in that folder.
0
votes
2answers
158 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 | ...
7
votes
5answers
9k 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 ...
18
votes
3answers
1k views

Feature based XML vs. Object Model: Which is better for content type development?

I've been researching a few different ways to create content types and I recently discovered that you can use the Object Model to do this. All of the examples I have found online typically use XML ...
8
votes
3answers
3k views

Is there a way to see if an SPField was created by a user?

I have some code where I am going through all of the Fields that belong to a content type. I'm curious if there is a way to check to see if the SPField was created by a user or if it is a system ...
5
votes
2answers
157 views

SharePoint App VS Object Model

For designing solutions I am confused with whole Apps concept in 2013. What is Microsoft's guidance for when to use a SharePoint app and when to go for a traditional client or server object model ...
4
votes
2answers
3k views

Iterate through discussion list

I have SharePoint 2007 discussion list. I want to iterate over all items in the list, so I do the following: var list = web.Lists["discussion"]; var listItems = list.Items; foreach (var listItem in ...
3
votes
1answer
82 views

How do i “Refresh” each site collection's permissions?

My network admin have deactivated a lot of users from the Active Directory, and recreated them using the same username but with a different OU, Now the SP 2010 does not recognize these users or their ...
2
votes
3answers
2k views

Get absolute URL to listitem's default display form

I need to have an absolute URL of a listitem's display form - currently I do it the following way: On http://mydomain.com/: item.ParentList.ParentWeb.Url.TrimEnd('/') //"http://mydomain.com" + "/" ...
2
votes
1answer
999 views

Sending an email using sharepoint object model sharepoint 2010

i have been working on generating email in an event receiver using share point object model..i used the sputility.sendemail method..2 things are necessary in the email(email from and HTML body)..so i ...
4
votes
3answers
2k views

How can I modify a file stored in SharePoint via PowerShell?

I have some files in SP 2010 that are simply HTML, and I need to modify the contents of those files in a systematic manner. Is there a good way to do this using powershell? Imagine that I want to ...
2
votes
1answer
291 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 ...
2
votes
2answers
1k 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 ...
1
vote
0answers
156 views

Programatically adding All Authenticated Users

I want to give all authenticated users read access to a list (that stores some configuration for a feature). "All Authenticated Users" is a special concept in SharePoint, but the implementation ...
1
vote
2answers
1k views

TaxonomyField.SetFieldValue throws “Specified method is not supported” Exception

I'm trying to copy a list item from one list to another. The lists are on the same site and the code is being fired inside of an item added/updated event receiver). Both lists have managed metadata ...
1
vote
1answer
1k views

Getting hold of the document sets in a library

I am sure something wrong with the following code. There are over 400 document-sets in the library and script only shows 8. Please suggest which line is messed up. (At one time I could get this work) ...
1
vote
2answers
1k views

Server timeout issue when getting 500000 records from SharePoint 2010 list

I am working on Sharepoint 2010. I want to get 500000 list items from the "Announcement" list. I got server timeout issue and the code is given below SPList list = web.Lists["Announcements"]; SPQuery ...
0
votes
3answers
69 views

SPFolderCollection valid index arguments

SharePoint 2010, c# server object model, VS2012 Long story short, I'm trying to fetch a folder of a document library, create a new folder in it from an array of names, then fetch the new folder via ...
0
votes
1answer
657 views

SharePoint Object Model: how to query ONLY last major version of data from Publishing Page?

I came into a situation where I wanted to use SharePoint Object Model SPSiteDataQuery to query data from Publishing Page. However, I dont want the data query based on the permission on current login ...
0
votes
1answer
2k views

GridView control - paging with linq. Where is objectDataSource?

I have visual web part with custom logic which retrieves me strongly typed list (not SPList -> .NET list object) which than I bind to gridview which has paging enabled. That works fine. Problem is: ...
0
votes
1answer
156 views

SharePoint Web Part Gallery details of each web part

When using SPWeb.GetCatalog(SPListTemplateType.WebPartCatalog), it returns an SPList which of course contains a SPListItemCollection of the web parts in the web part gallery. When looping through the ...