Representation of a list item within the SharePoint API.

learn more… | top users | synonyms

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 ...
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 ...
1
vote
2answers
167 views

Deleting all items from a list and then adding new items will not give the new items id 1,2,3 etc

I have a list with 3 items. When I delete these 3 items and add new items they get ID 4, ID 5 and ID 6. But I want the new items to get ID 1, ID 2, and ID 3. Is there any workaround? This is how I ...
0
votes
1answer
98 views

Read from an excel Sheet and write to a List

My requirement is that, i need to upload data from an excel sheet to an existing sharepoint List in SP 2010.I will have 2 different Lists Like this. Then I need to compare Both the List and retrieve ...
0
votes
4answers
79 views

SPListItem.Delete() has some issues

I have a list which consist of more than 5600 items. In my application i will search all the items from particular date range by using SPquery. As the result of the SPQuery, the splistitem collection ...
1
vote
1answer
150 views

Delete List Items Using PowerShells with Date Filtering

I've been trying to delete more than 10,000 list items in SharePoint using PowerShell. So far, this is what I've had [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, ...
0
votes
0answers
88 views

Fail to update a SP List item from JS

I am trying to update a list item from a list with a single column 'Test' and I'm getting the following error: Request failed. This task is currently locked by a running workflow and cannot be ...
0
votes
2answers
394 views

Save conflict when trying to update a listitem

In my SPItemEventReceiver I have two methods one ItemCheckedOut and one ItemUpdated. In the ItemCheckedOut I update one listitem column. In the other one I do some other updates to the listitem. ...
0
votes
1answer
78 views

Best way to update 200 items on a list [closed]

Situation in a VS2010/SP2010 site: List A with main items List B with subitems, having a lookup column that points to List A ID There are about 200 subitems for each item The Page where users edit ...
0
votes
2answers
247 views

Inserting new list items into SQL

When I add new item into the list, I have to insert the items into the SQL database. How can I do it? Any clue is good for me.
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 ...
0
votes
2answers
94 views

How to Upload Documents using Visual Fox Pro

We have an application written in foxpro, part of the application is creating reports (basically excel and pdf files), i would like to add the capability of uploading those files to a sharepoint list, ...
0
votes
0answers
18 views

Retrieving the SPLookupFieldCollection with particular ID's

The situation is following: I have this kind of string = 58;#value;#59;#value2;#60;#value3;.... So as you see this is just if i do: SPFieldLookupValueCollection collection= new ...
0
votes
1answer
78 views

OnWorkflowItemChanged fire multiple times

I have been using a State Machine workflow (SharePoint 2010). Workflow design Main State: The Main State does not update the item. The Main State contains a OnWorkflowItemChanged. When the item ...
0
votes
0answers
166 views

Object refenrece not set to instance of an object - list template items

This may be a duplicate, because this error is pretty common in every part of sharepoint. However, the search function didn't find anything for my particular problem. To the problem: I have a List ...
0
votes
2answers
285 views

Populate list item from XML feed

How to create new list item using data from XML feed? Is it possible to handle multi line of text in XML feed?
0
votes
1answer
40 views

MOSS 2007 stripping out URL in SPListItem

We have a SharePoint List with a multi-line text column. In this column we have HTML code. When I retrieve the column in an SPListItem, the url is often stripped from the string. If the SharePoint ...
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 ...
0
votes
0answers
41 views

File in document library is missing SPListItem

I have a "Master Page Gallery" where I can get some files using myList.RootFolder.Files but they do not exisit in myList.GetItems() Using powershell I have found the file has all valid data but no ...
3
votes
1answer
121 views

Get actual item from SPRecycleBin

Similar to this question, I need to permanently delete only specific items from the recycle bin. I need to know more than just their names, however, and SPRecycleBinItem seems to have only have a ...
0
votes
2answers
180 views

add SPListItem with more than one field of data

I want to add an item to a SharePoint task list, with data in the Title, AssignedTo, and Status columns. The code below adds the item with data in the Title column, but no data in the other columns. ...
0
votes
1answer
146 views

Programmatically adding a sequence number to the 'Title' column during item creation in SP List

As per the title above, I have a list that stores IT support requests. I need a sequence number that matches with the item ID and I want to add this sequence number to the Title of the request. I ...
1
vote
0answers
101 views

send email to users including alert template with list items using visual studio?

I don't want to set list alerts when items created or changed. I want to send email(including alert template and all fields in item) to that user which not configured in sharepoint. My function for ...
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 ...
0
votes
1answer
126 views

Set SPBuiltInFieldId.WorkflowInstanceID value

I start worklfow programmaticaly on SPListItem (custom ContentType). When i try to save all fields but "WorkflowInstanceID", its ok. But, item[SPBuiltInFieldId.WorkflowInstanceID] = ...
0
votes
2answers
362 views

How to display list item attachment to a user without permissions on the list

I have sharepoint list/library. Only admin user has permission on this list. Now i want to display attachment to all authenticated user in my custom web part. How can i achieve this functionality.? ...
0
votes
3answers
1k views

Better way to get a SPListItem by Field

I want to get a SPListItem from a SPList where a field match a value. I have to ways to do it, CAML and LINQ. My code is: LINQ ... SPList list = Web.Lists["MyList"]; SPListItem item = (from ...
0
votes
1answer
211 views

Proper way to evaluate/get status of boolean field when looping through SP List with code

What is the best way to do this when looping a list? I have tried to evaluate it with something like this but it wont let me evaluate bool as an "if" condition if (item["ShowTitle"] == true) //do ...
0
votes
1answer
189 views

Double value in URL from SPListItemCollection result

I have a basic list which I am using to generate a "Quick Links" menu WebPart. It looks ok but for some reason the URL field (of URL type) when rendered renders html that looks like this: <a ...
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 = ...
0
votes
0answers
47 views

Access unable to update singular column in SP list

When I try use Access 2007 to update a linked SharePont table, Access tries to update the entire list rather then the column I specify in my query. Anyone else encounter this problem?
1
vote
1answer
175 views

What is the difference? (Checked out files)

I am in the process of writing a powershell script to work with checked out files and I stumpled on this article: Find All Checked Out Files My question is what is the difference between the two ...
0
votes
1answer
1k views

How to get the sharepoint website url in a workflow from the current SPListItem?

I am using sharepoint 2010 and have created a workflow in vs. In this workflow I create some tasks and fill the title, bodytext and assign it to a user or group. In the bodytext I add an hyperlink as ...
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); ...
0
votes
2answers
293 views

How to call a c# method in my XSL File

I have two lists Client and Project, each Client has from 0 to N Project stocked in his SPLookupField where multi values are allowed. And I created a new computed Column in the Client List where it ...
0
votes
2answers
159 views

Adding extension methods to SharePoint types

Heads up, this is very much a beginner question. My SharePoint experience is primarily with working with SharePoint designer and powershell. I've never touched Visual Studio or anything to use custom ...
1
vote
0answers
326 views

SPListItem.Update Not working

So I have this really simple function which updates a couple of fields on two different lists (one is a document library) The thing is on the document library does not updates any of the fields I need ...
1
vote
0answers
199 views

Get SPListItems based on contribute permissions, programmatically

I have a problem in getting the list items the current logged user has contribute rights on. I have this scenario: List A has read permissions for anonymous access. Group 1- Has contribute rights ...
1
vote
0answers
307 views

Can I set SPListItem Item.Id programatically

I want to delete some list items and recreate them using a csv file. I can see if I delete the items and then recreate, Sharepoint adds it's own auto icrement int. what if I want a set of fixed values ...
0
votes
2answers
1k views

Sharepoint 2007 Powershell: $item.update() gives error that file has been modified

I am trying to programmatically update some metadata for a sharepoint item using powershell. Here is my code: $web = getWebByURL("http://test-site/spadmin/") $itm = $web.lists["Documents"].items[0] ...
0
votes
2answers
115 views

is this CrossSiteListViewWebPart causing memory leaks?

i would like to know, whether I should be disposing the SpWeb object or I have closed it and trying to use it? using System; using System.ComponentModel; using System.Web; using System.Web.UI; using ...
0
votes
1answer
112 views

where i can find trace for item.systemupdate()

I am working on a project which was initially developed by someone else. few of my list items are getting updated but i am not getting anything in version history. I believe that some schedule job is ...
0
votes
1answer
500 views

Update custom property on listItem using -replace in powershell?

I have two different web application with one site collection each. One Site collection is privat and the other on is public inside the intranet. The public site links to the private site which link ...
1
vote
0answers
169 views

SPSiteDataQuery without subfolder items?

I'm trying to use the SPSiteDataQuery to return the contents of several lists across a site collection. The problem I'm having, though, is that while there are only a few documents at the root level ...
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 ...
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. ...
5
votes
2answers
317 views

SPQuery returning different before and after using RunWithElevatedPrivileges method

I am having a huge problem here. I am executing a query looking for a SPListItem, when I execute this query with user identity it works well, retuning the fields "Author" and "Editor" that I need. ...
1
vote
1answer
201 views

How do I get the current Editor of an Listitem while ItemUpdating?

How can I get the current Editor of an list Item in SharePoint 2010 during ItemUpdating? Problem is properties.AfterProperties["Editor"].ToString() throws and Exception cause it's null. This ...
0
votes
1answer
294 views

How to change file in sharepoint library?

I have sharepoint documents library and I have wcf service from where i should download new version of document file on button click. So i got next method: public void UpdateFile(SPListItem ...
2
votes
2answers
967 views

How to add a blog post programmatically?

I'm trying to create a C# script that will allow me to import blog posts from a different system (exported as CSV) into a SharePoint blog. I have found a script for comments to a blog post, but I'm ...