As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [splistitem]

Representation of a list item within the SharePoint API.

Filter by
Sorted by
Tagged with
5 votes
2 answers
9k views

Converting ListItemCollection to List<t> efficiently

I am getting items from a sharepoint list, like below, and then appending these to a list of the object type. I can't help but feel this is a slow way to populate this list, looping through each list ...
Jacob's user avatar
  • 333
1 vote
2 answers
1k views

SharePoint get field value as text

For JSOM we have a great method called get_fieldValuesAsText that returns formatted field value. The same value as user can see it in the list. I am really supprised that I can't find anything like ...
Serhiy's user avatar
  • 379
2 votes
2 answers
10k views

RegEx to validate and replace invalid file name characters from a custom web part file upload control

Scenario: I have a fileupload control in my custom webpart that attaches the uploaded files to the list item. The attachment code is given below: private void UploadAttachments(Helper ...
Muhammedh's user avatar
  • 1,157
1 vote
1 answer
119 views

SPListItem update conflict

Task: when user updates an item, change synchronously another hidden field of this item. Problem: save conflict occurs AFTER update is called (not on this line). I subscribe on EventReceiver's ...
Alex Zhukovskiy's user avatar
0 votes
1 answer
291 views

SSOM Embed Code when inserting list item

Clicking this button in the list's ribbon, I can properly embed HTML so SharePoint doesn't strip anything out. I have some HTML that I need to insert into a list item field via C# code. How do I ...
KidBatman's user avatar
  • 381
1 vote
1 answer
509 views

ThreadAbortException on SPWeb.ProcessBatchData

I am trying to update ~2000 list items with SPWeb.ProcessBatchData. After exception on all items at a time, I tried them in small batches like 100 and 200 but after executing first 1 or 2 batches i.e. ...
Ashish's user avatar
  • 401
3 votes
2 answers
147 views

Problem with bulk items insert in SPList (works fine for 200 but not if item exceeds )

var itemArray = []; for (var i = 0; i < data.length; i++) { var items = data[i].split(","); downloadID = items[0].trim(); noOfDownloads = items[1]; ...
Rupesh Rai's user avatar
2 votes
1 answer
349 views

CustomSolution Error - Object reference not set to an instance of an object

atm I'm implementing a custom solution in our SP 2010 farm to receive emails on an specific custom list. With the following code it's possible to add one entry, with an email-body contains one line ...
Flaash's user avatar
  • 23
1 vote
2 answers
371 views

Update current item [duplicate]

I am trying to update current items, but all items in the list get updated why? public override void ItemAdding(SPItemEventProperties properties) { using (SPWeb web = properties.OpenWeb()...
Batistuta's user avatar
  • 718
0 votes
3 answers
117 views

Update listitem problem

i am trying to update a listitem in a event receiver on FeatureActivated in a document library. public override void FeatureActivated(SPFeatureReceiverProperties properties) { ...
Batistuta's user avatar
  • 718
0 votes
0 answers
36 views

How to avoid character limit when uploading document via VB app?

We have an in-house application that, among other things, generates an Excel spreadsheet and then uploads it to a document library on a SharePoint 2013 site. I sent the developer the UNC path to the ...
Omegacron's user avatar
  • 1,802
4 votes
1 answer
3k views

Update readonly field using REST API

I am trying to update a list item using Rest API. Following is my code. It works and it updates all fields except "RichMessage" which is a Note field with RichText="TRUE" and readonly. I have tested ...
Medes's user avatar
  • 2,086
0 votes
1 answer
102 views

Re-Deploying SharePoint List removes all the submitted ListItems

I created a SharePoint List using Visual Studio 2013 and deployed it. Later I had need to add few more columns in the List. So after adding more columns when I deployed it again then what I realized ...
soccer7's user avatar
  • 909
0 votes
1 answer
58 views

Want to create a navigation bar from list item which redirects to another page or document

Navigation bar should get populated from List items(Hyperlink items) that maps to pages or another document. Share Point 2010
seema's user avatar
  • 11
1 vote
3 answers
7k views

PowerShell Script to retrieve every and only List / Library items in a specific view in SharePoint 2010

I am trying to iterate over each item in specific view for a list in SharePoint 2010. What i have so far works to return items in the view, but only the items in the first paginated view for that set....
EFighter's user avatar
0 votes
3 answers
2k views

Retrieving ContentType from SPListItem is NULL

I am trying to get the ContentType.Name of the Event (SPListItem) however it is NULL when I try to access it. I'm getting a value for the ContentTypeID, so I would assume that I would be able to ...
TreK's user avatar
  • 111
0 votes
0 answers
659 views

Renaming a file with ItemAdded Event Receiver

I am using an Event Receiver to rename a file in a document library. For some reason this doesn't seem to work. public class EventReceiver1 : SPItemEventReceiver { /// <summary> /// An ...
christopher clark's user avatar
1 vote
1 answer
2k views

Modify list item field using PowerShell

I have a list field that stores an XML string. I am trying to get the XML contents and modify a particular tag in the XML like so: foreach($item in $list.Items) { if($item["XMLField"].Contains("...
KidBatman's user avatar
  • 381
0 votes
1 answer
31 views

Creating a TimerJob that renames files

I have been tasked with figuring out how to rename files that are coming into SharePoint. We have an External list that does not have pictures stored as blobs or even images within the SQL Database ...
christopher clark's user avatar
1 vote
0 answers
168 views

Close modal after form have "saved"

Im trying to trigger a page reload after my editform is done. I know that I can create a js function, "presaveitem". But this is called before the item is saved. I need to trigger some custom JS ...
Mikkel Nielsen's user avatar
10 votes
2 answers
807 views

Efficient way to retrieve all list items

I am retrieving all items from list containing around 4000 items. But it seems to take longer time to fetch all items which is ~15 to ~22 seconds. Is there any best way to fetch all items from list in ...
Ashish's user avatar
  • 401
1 vote
1 answer
543 views

SPContext.Current.ListItem randomly returns null (custom form)

I have noticed this once pushing the current code to production. following is the code under ddlEnWipeReason_SelectedIndexChanged (inside the update panel): using (SPSite curSite = new SPSite(csURL)) ...
hoora hessam's user avatar
4 votes
1 answer
4k views

SystemUpdate() in list item update

What's the advantage/reason for using SystemUpdate() over Update() when list data update?
Sivakumar Piratheeban's user avatar
2 votes
1 answer
479 views

Get all list items versions from client side

I am trying to get all versions from every item in a SharePoint list using only client-side through a web part. Following the exemple at http://techfindings-prem.blogspot.ch/2014/06/how-to-get-all-...
Andy Christen's user avatar
5 votes
2 answers
54k views

REST to get list item by Id

I am always comfortable using JSOM, and I have used less of REST calls to access lists and its Items. But now I have a requirement to use only REST to get item by its ID. Is there any code snippet ...
Asad Refai's user avatar
  • 5,983
1 vote
2 answers
15k views

Error:Access denied. You do not have permission to perform this action or access this resource

I am retrieving items from SP lists. But when I try to deploy my solution through VS 2013 it says Access denied. You do not have permission to perform this action or access this resource. ...
N.Sahraoui's user avatar
0 votes
1 answer
2k views

Show list items in AngularJS ng-grid

retrieving SharePoint list items by REST with var app = angular.module('myApp', ['ngGrid']); app.controller('MyCtrl', function ($scope, $http) { $http.get('http://whereever/_api/web/...
Celophysis's user avatar
0 votes
1 answer
28 views

Date value retrieved from an item keep on increasing every few seconds

I was trying to retrieve items from a SharePoint custom list called "Some Events" using JSOM. Title, Venue, EventDate were few fields I was retrieving. Every thing worked fine except EventDate. ...
Asad Refai's user avatar
  • 5,983
7 votes
2 answers
40k views

Getting an ItemCount with filtering in SP2013 using REST api

I am attempting to return an integer (itemcount) of the items within a SP2013 list. I have done this easily using the stock standard json method. However I have a need of counting the splist items ...
geostima's user avatar
  • 175
1 vote
1 answer
1k views

Refresh parent page after closing list item dialog

I'm trying to refresh the parent page of a list when closing the dialog of a list item. Is there a way to achieve this with javascript somehow? I inspected the button in the DOM and tried to write a ...
KidBatman's user avatar
  • 381
0 votes
1 answer
45 views

Check Child Items When Parent Status Column Is Changed

What is a good strategy to prevent a change on a parent item in a SharePoint 2010 list if a related child item (i.e. the child of the parent) column is set to open? For example, I don't want to allow ...
motionpotion's user avatar
  • 2,197
0 votes
2 answers
394 views

Redirect at the end of event itemupdated

I'd like to know if there are a way to make a redirection in an event receiver of a list itemUpdated and not updating. I need this because in my event, i create a file in a folder and of a document ...
user1898765's user avatar
4 votes
3 answers
7k views

Add New List Item With Attachment Via Excel VBA

I have users that have a schedule template in Excel (2010). I'm wondering how I can code via Excel VBA to create a new list item and attach the Excel worksheet they are using that contains the ...
Matthew Blackburn's user avatar
0 votes
2 answers
1k views

Unable to cast object of type 'Microsoft.SharePoint.SPListItem' to type 'Microsoft.SharePoint.SPFile

In code below, at mentioned line I am getting this error: How I fix this? SPList docLib = WSweb.GetList(WSweb.ServerRelativeUrl + "/Documents"); //SPList docLib = WSweb.Lists.TryGetList("Documents"); ...
SPBeginer's user avatar
  • 2,537
1 vote
2 answers
5k views

How to foreach through a list and get distinct values from specific columns C#?

I'm able to loop through a list on sharepoint and get the information I need from selected columns, but how would I loop through a list and get only distinct values from a column in C#. For instance ...
zingwing's user avatar
  • 779
1 vote
2 answers
2k views

Sharepoint2013 ctx and Js : Retrieve the value of a field from a list

I'm a totally beginner and totally stuck to a point in my Sharepoint project. What i would like to achieve: part 1 : retrieve the current user's Department's name part 2 : retrieve the department's ...
Gaelle's user avatar
  • 592
0 votes
0 answers
520 views

is it possible to retrieve the current value in sharepoint list item before save

I have a sharepoint list. On the edit form of list item i have a custom action button to send the mail containg the contents of the list columns . If the user changes any value in a column and then ...
Deepika's user avatar
  • 505
0 votes
2 answers
552 views

Insert image from ActiveDirectory to SPListItem c#

First of all, I would like to ask question, do I need to insert image to Sharepoint as Image or byte[] array? I have tried both ways to do that. In both cases it returns me System....
Taurib's user avatar
  • 315
0 votes
0 answers
118 views

Change selected items order and merge using Javascript

I am now able to get the selected list items and merge its contents. Is there a way to reorder the selected items before merge? Or is there a way to get the items in the order in which they are ...
Keerthi's user avatar
  • 1,113
1 vote
1 answer
76 views

email data from sharepoint list to specific people

I have a sp 2010 cutom list. Whenever the list gets updated, an email should be sent to some specific people and body of the email should be taken from "messageList" I searched net, most of the ...
Deepika's user avatar
  • 505
0 votes
1 answer
2k views

How to get the SPFieldLookup object from a SPListItem

I have an SPListItem from a SPList That contains a Lookup Field. How do I do to get the SPFieldLookup object from this item? I need to get the other fields from this object an not only the title.
ameliapond's user avatar
1 vote
2 answers
170 views

Latest unique item from a SP list column

I have a SP2010 list.This list has a choice column. I want to create a view with the unique items(latest one) from this column. How to achieve this?
George's user avatar
  • 1,482
2 votes
1 answer
66 views

SharePoint 2010 keywordQuery

I am using the keyworkQuery class to fetch some items from a Sharepoint 2010 list. I need to fetch also the Attachments for each item how can I do?. I tried: KeywordQuery kw = new KeywordQuery(proxy)...
Nk SP's user avatar
  • 2,883
1 vote
1 answer
681 views

Item Field returning value with hash character in Itemupdate

I am trying to get value of item field from the list. The field is a lookup field with integer value. When I am trying get the value it is coming like 9;#9 (shown below). But I need only 9. web....
James123's user avatar
  • 466
1 vote
1 answer
2k views

Choose (select) person or group from sharepoint list column

Is possible to create a column to populate users and select them using AD group. I know we have person or group column which we can type. But I am looking by selecting from the dropdown list. How to ...
James123's user avatar
  • 466
0 votes
1 answer
369 views

Assigning a lookup value field, passes through as a blank string

I've currently got a new task list item for a certain content type (DMR) which fails to take through the lookup to the associated list. The statement prints the correct record number in the immediates ...
Matt's user avatar
  • 41
0 votes
2 answers
117 views

Iterating through list items by name

I have a conditional statement that uses named columns of a list item. Eg. Stage 1, Stage 2, Stage 3.. Is there a way that I can iterate through them to satisfy the problem I'm having when stating the ...
Matt's user avatar
  • 41
2 votes
2 answers
4k views

Basic question: Difference between List.items and List.ItemCount in SharePoint

Just for clarifying, I have written following two lines in Powershell script and see output as: $web = Get-SPWeb http://intranet; $list = $web.GetList("documents"); $items = $list.items; i see ...
SPBeginer's user avatar
  • 2,537
0 votes
1 answer
60 views

Change Document content type by link to document

I've a document library and i've to delete document to replace it by a link to an external url. So i thinked to add a content type "link to document" Make a script client to change content type of my ...
user1898765's user avatar
0 votes
1 answer
26 views

Delete document but keep meta

I've a document library with a lot of documents. The documents are in an other program and we 'd like remove the document from sharepoint and replaces by a link to the document in the other program. ...
user1898765's user avatar

1
3 4
5
6 7
11