Represents a field in a list on a SharePoint Foundation Web site.

learn more… | top users | synonyms

5
votes
4answers
18k views

How to set ListItem Lookup Field value

How do I set a ListItem's Lookup field using code? SPFile file = list.RootFolder.Files.Add(destUrl, iStream, true); SPListItem item = file.Item; item["DocumentID"] = DocID.ToString(); ...
3
votes
6answers
4k views

ArgumentException when trying to access SPListItem value

I have a tool to update all items in SP (link replacement). The tool works most of the time but sometimes it throws me an ArgumentException ("Value does not fall within the expected range."). Here is ...
7
votes
3answers
2k 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 ...
3
votes
2answers
990 views

Using PowerShell how do I change the column ordering for a SharePoint List

Been trying to search for the answer to this, what I need to do is re-order the fields of a SharePoint list and propagate that change down to 300+ sites (should have used a content type, but oh well) ...
2
votes
2answers
1k views

SetCustomProperty within OnSaveChange

Saving Custom Field Type properties using SPField.SetCustomProperty within the IFieldEditor.OnSaveChange event does not seem to work, for reasons explained elsewhere. I've seen all kinds of bodges ...
1
vote
2answers
226 views

Updating 'Created By' field in SP2010 programatically

I'm trying to import data from an .xml file to a custom list in SP2010(created programmatically). I'm able to create and update all fields except 'Created By' as it says that "Cannot update read only ...