Representation of a list item within the SharePoint API.

learn more… | top users | synonyms

2
votes
2answers
600 views

Adding list item when user does not have permissions question

I am trying to programmatically add a list item to a SharePoint list. The code works fine when executed by a user with contribute permissions, but does not work when a user has view only. Funny thing ...
2
votes
2answers
101 views

Dates and times in Properties vs Fields

I'm trying to roll my own archiver for SharePoint. I always try to let the underlying object serialize itself. Only when it fails do I try to use .ToString(). Anyway, while inspecting the Properties ...
2
votes
1answer
135 views

Why do I have 2 ways of retrieving an average rating? Which one do I choose?

It appears that, on enabling social rating against my list for my custom content type, I now have 2 extra fields for each SPListItem in my list: AverageRating and RatingCount (as explained Blog Link) ...
2
votes
3answers
466 views

Disposing item.web

I have read this article and known which objects should be disposed. But I doubt whether oItem.Web returns the same object as spcontext.current.web object or it creates new one. If it creates new, I ...
2
votes
2answers
138 views

Retrieving the highest value from list

My question is regarding retrieving a value from a sharepoint list. Basically I have a list with some data. One of the fields in the list is a text field with numbers. So what i want to do, i want to ...
2
votes
1answer
566 views

Parse pasted images from Outlook emails as attachments in Sharepoint list

I have a Sharepoint list with incoming email enabled, and an email event receiver to create items out of incoming emails. Once an email is received, it sends an email back to the sender with the ...
2
votes
1answer
1k views

Updating a SPFieldMultiLineText field

I have an SPListItem. I have a field on the item of type SPFieldMultiLineText. How can update the value of that field?
2
votes
1answer
685 views

SPListItem removing HTML attributes?

I want to add this to an SPListItem HTML field (Multiline text) <a href="#" onclick="OpenDispPage('Table 1.1', 'table');" >Text</a> and this is what SharePoint makes out of it when I ...
2
votes
3answers
53 views

SPServices is the Document Checked Out SP2010

I was wondering if anyone knew how to tell if an item has been checked in or out from SPServices? I am able to get all of the nodes but I do not see one which captures the checkout. Is there a way ...
2
votes
1answer
48 views

Formula to save seconds and Milliseconds in Sharepoint List for DateTime type column

is there any way to hold datetime with seconds and milliseconds in sharepoint list where column type is 'DateTime'. currently my list column saving as below 1/9/2014 6:30 PM but i need to show it as ...
2
votes
1answer
195 views

CAML Query to Sort list items based on Modified date

while sorting sharepoint list items based on 'modified' column, its not considering seconds and milliseconds, i need sorting to be done on Milliseconds too, why because i have multiple list items ...
2
votes
1answer
753 views

How to check if user has read/write permission for a SPListItem in c#?

In my SP2010 visual webpart, I am checking permissions with the code below. Basically the current user is either an admin or a regular user. If they are an admin, they need to have permission to edit ...
2
votes
3answers
2k views

Randomly: Item does not exist. It may have been deleted by another user

I have a rather curious issue with some workflow tasks. My (state machine) workflow creates a handful of tasks while running. Users interact with the tasks to move the workflow between its states. ...
2
votes
1answer
661 views

How to update SPListItem in ItemFileMoved?

I have a document library. In ItemUpdated I move the file to a different location (based on date) and I want to add some metadata in ItemFileMoved to the file's new columns (which I added). The ...
2
votes
2answers
105 views

Getting latest datetime from a splist

I have sharepoint list with data and one of the columns contains date ... how can i programmatically retrieve the latest date, the field is a Date And Time type?
2
votes
1answer
4k views

How to retrieve all items from a list (with custom fields) by javascript object model

I need to get all my custom fields from my list by Javascript Object Model.. The code I wrote down is this: var items; $(document).ready(function () { ...
2
votes
1answer
1k views

SPListItem item[“Author”] throws ArgumentException on blog lists only for some users

We have a webpart on our SiteCollection home page which aggregates the most recent posts from a number of blog subsites. The code looks like this: using (SPSite site = new ...
2
votes
5answers
1k views

List Item Timeout

I am trying to open/close the a custom list item with 11500 items but I am getting an error which seems to be a timeout error, i checked the logs and found 'Unable to execute query: Error 0x80131530'. ...
2
votes
1answer
1k views

set separate url and description for URL-field via javascript

I've got a list item with a field of type URL. As you know, an URL-field consists of two parts: a description and a URL. Using javascript to update a field that consists of one part is easy, you ...
2
votes
2answers
1k views

Can an event receiver update a list item before the alert email is sent?

I have a requirement to expose a list item's ID value on the "DispForm.aspx" form and all alert emails for a particular list. SharePoint is very "protective" of its IDs (or counter fields) and it ...
2
votes
1answer
302 views

Duplicates of SPListItem when two quick requests occur

We got code, running on page load. That code asks certain SPList for its items by CamlQuery, which gets only items with specific (current) user in one field (field A) and with some value in other ...
2
votes
1answer
851 views

Search Optimization on SPListItemCollection

I have an SPListItemCollection (Thread Discussion Collection) that consists of almost 20,000 items. Each SPListItem (Thread Discussion) on the SPListItemCollection contains a sub SPListItem(Thread ...
2
votes
1answer
45 views

“nativehr” error while trying to delete list items through ProcessBatchData

Plain and simple, I'm trying to delete a massive amount of items from a list as quickly as possible using a c# app, and have seen references to batch processes being the best way to do this. Not ...
2
votes
0answers
126 views

“User cannot be found.” Error While Updating List Item

I'm experiencing a weird error while trying to update the author and editor on some files in a site, but not all, and the behavior is strange and inconsistent. The code: SPListItem item; int newID; ...
2
votes
0answers
73 views

Bulk file upload creates multiple versions of all files except last file

I have an interesting (well to me anyways) problem here. I am doing a code based mass upload of documents into a SharePoint library with a twist. The twist is that the file's last modified date ...
2
votes
2answers
328 views

Unable to update list item - Additions to this web site have been blocked

I am developing a SharePoint job. In the public override void Execute(Guid targetInstanceId) method, my code goes: SPSecurity.RunWithElevatedPrivileges(delegate() { int count = ...
2
votes
1answer
186 views

How to import one single row of data from excel to one list item in a SharePoint 2010 list?

I have a problem where we want users to attach a file to a new item and the SharePoint list will automatically read on row or column of data (maybe 20 cells-worth of data) and populate some additional ...
2
votes
0answers
609 views

Url to an item with Client Object Model

Regarding my question, at this moment i'm writing some client object model code and I can't find a way to retrieve create make an url ... My question now is: How can I create an url to an item? I ...
2
votes
0answers
121 views

Is my Object Casting Model acceptable?

I'm creating a SharePoint application, and am trying some new things to create what amounts to an API for Data Access to maintain consistency and conventions. I haven't seen this before, and that ...
2
votes
1answer
180 views

SPListItem update yields ItemUpdated/ing Numbering Scheme not found

I've written a console app that searches items in a SP document library (MOSS 2007) for a specific condition and updates the value in a column for each item that meets the criterion. I run the console ...
1
vote
3answers
4k views

Getting specific SPFile from document library

I have a Document Library called "x" with file named "y". I am curious what the best way to get the SPFile object for the specified SPListItem. Currently I am using this: ...
1
vote
3answers
2k views

Getting “Object reference not set to an instance” but column name exists

The NewsCaption field exists (both display and internal name is NewsCaption). I even saw it exists when I went to watch window and show this field listed in the SchemaXML for the fields element. I am ...
1
vote
2answers
814 views

Add/Copy SPListItem object to Sharepoint List

explanation: I have fetched list items based on conditions. Like this. var query = from SPListItem oItem in splist.Items where ...
1
vote
4answers
1k views

How to delete an item on ItemAdding

I want to performe some Action on ItemAdding. I have a Custom List that reacts on Item Creation. In particular on Item Adding performs some action using the After Properties.. If, at this level, i ...
1
vote
2answers
416 views

ListItem Versioning Differences

Does anyone know how to programmatically determine if any non-system fields have changed between ListItem versions? I realize that I could iterate through the fields between each version and if I see ...
1
vote
2answers
1k views

Unable to update item using powershell when event reciever is enabled

I have a powershell script that I am using to update some list items programatically. It seems to work as I expected when I disable the event reciever that is associated with the list however when I ...
1
vote
3answers
435 views

Do I need to do an update after set permissions on a listitem in the ItemAdded event receiver?

I have an event receiver on itemAdded. I set some permissions like below. SPRoleAssignment role = new SPRoleAssignment(spPrincipal); ...
1
vote
2answers
191 views

Is it possible to update the searchindex for only one item?

Is it possible to update the searchindex for only on specific item. I'm search some tasklists through keywordsearch and showing them in a webpart. Then I have a custom action which changes the status ...
1
vote
2answers
386 views

Updating an SPListItem without knowing SPSite or SPWeb

I'm building a custom web part that is running an SPSiteDataQuery. I will be running this query across all site collections, and displaying the results, together, in 1 web part. Users interacting with ...
1
vote
2answers
208 views

spfielduservaluecollection.remove not working

I want to remove the user from the list item from the column of type person or group and it is multi-valued. My code is: private void DeleteUserFromList(SPUser userDeleted, string ...
1
vote
3answers
2k views

How to programmatically restart a workflow

I have a workflow linked to my list. Is there any programmatically way to select a list item and restart the associated workflow? Something like: SPListItem item = List.Items.GetById(1); ...
1
vote
1answer
768 views

Getting User details from field “AssignedTo” in a custom List

I have a Custom List, which have different fields, when I click on any user in field "assignedTo" it navigates me to another window and I can see user's Account, Name, email etc. I am able to get all ...
1
vote
1answer
547 views

Customize AllItems.aspx

I have a list "Projects". Each ListItem stores which users are working on that project. I have 2 groups within SP - "ProjectManagers" and "ProjectMembers". Now I want to customize AllItems.aspx ...
1
vote
2answers
205 views

GetItems(cQuery)

The following code seems to be working. Basically, I have multiple items in a document library and I need to run a cleanup PS. Do I need to add Dispose as I am not running under the Using context? ...
1
vote
2answers
230 views

SPListItem.Attachments - what type cast?

When iterating through a SPListItems SPAttachmentCollection what type cast am I supposed to use? SPFile or SPFileStream or something else? I want to display the item's filename and when it was ...
1
vote
1answer
731 views

Odd and Even list item color

i saw a sharepoint where its list item as a background color (blue) for odd list item number and another (white) for even numbers. I dont know where i can set this. I looked into designer and i could ...
1
vote
1answer
903 views

Export-SPWeb with Where Clause to filter List Items?

I am trying to export list items to a local folder but I only want certain items, not the complete list.Is this possible? I have tried to iterate through the SPListCollection with the "Modified" ...
1
vote
4answers
1k views

Returning a SPListItem in conjunction with RunWithElevatedPrivileges

* *Clarification. Application == Site Definition. Direct Database access is out the window ** I've created an application for SharePoint that utilizes some new approaches to coding List Access. I've ...
1
vote
2answers
1k views

update SPList using csv via Powershell

knowing that is possible in PS, exporting SPList items to PS objects(link1 link2) what is the best way, to go into the other way: Create/Update an SPList from an exported csv or format-table.
1
vote
2answers
875 views

URL : How to add multiple Query String within Source Query String?

I have a simple question regarding the &Source Query String in SharePoint 2007, which normally SharePoint used in on List Item page, when click on "Close" button, it can redirect back to the ...