Representation of a list item within the SharePoint API.
0
votes
2answers
70 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
70 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 ...
1
vote
1answer
341 views
Set data to Sharepoint Gridview from List and remove appropriate selected columns
I am using c# and I have a SPList with fields such Title and Translation. I want to set Word and Translation into SPGridview.
I can retrieve data from my List:
string translation = ...
4
votes
1answer
781 views
SPList.Add() vs SPList.AddItem() SharePoint 2010
Using some test code i found out that SPList.AddItem() executes slight faster then SPList.Add() - does anyone know why is it so ?
DateTime start = DateTime.Now;
SPList ...
1
vote
1answer
708 views
Adding SPListItem using SPWeb.ProcessBatchData method
I am looking for adding SPListItem using SPWeb.ProcessBatchData method. Could any one please help me on syntax for adding list item to my custom list.
0
votes
1answer
208 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 ...
0
votes
2answers
395 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
0answers
114 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 ...
4
votes
2answers
198 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
78 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
103 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 ...
1
vote
2answers
301 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 ...
0
votes
1answer
275 views
The SPListItem provided is not compatible with a Publishing Page
Whenever I try to save og check in mmy Home.aspx pagelayout welcome page I get
Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.
And this:
...
1
vote
0answers
87 views
Is there a way to catch the transition of a SharePoint 2013 list item to Project Server 2013 project event?
As you may know, there is a feature in SharePoint 2013 that allows you to create a project in PWA from a list item (Ideation). I need to add a couple more settings for that list item and the resulted ...
2
votes
1answer
293 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 ...
4
votes
1answer
196 views
Get SPListItem from LINQ
I have used SPMetal to create a data context. I can query my lists. The queries return an object of the type of list that they are in. Is it possible to convert this type into a normal SPListItem ...
4
votes
3answers
2k views
How to get SP.Folder for SP.ListItem in SharePoint 2010 JavaScript Client Object Model?
I have a custom button on ribbon for document library and need to disable it if current SPListItem is an empty folder.
To disable button I use EnabledScript attribute of CommandUIHandler. I can get ...
5
votes
1answer
141 views
How can I tell if a document is 'being published'?
I need to use the relevant event receiver to tell if a document is being published, is this possible? I will settle for has 'just been published' - i.e. I have no preference between itemupdating and ...
0
votes
2answers
333 views
Setting value for Taxonomy field produces Value does not fall within the expected range
I have a custom ASPX page where the user inputs data and clicks Save to add new item to the list. The field My Department is a Managed Metadata field (single choice). The user sets the value for this ...
0
votes
1answer
559 views
How to get Attachment URL Programatically From Sharepoint ListItem?
How to get Attachment Full URL Programatically From Sharepoint ListItem?
Explanation:
I have adding new item with attachment.
Now i have to bind that attachment link to grid.
When click on that link ...
2
votes
2answers
68 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
2answers
47 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 ...
1
vote
1answer
123 views
Deleting SPListItem in event receiver - very long time
I have an event reciever with ItemDeleting action, in which i try to delete an item from another list (I cant realy use cascade delet behavior here, I need to do some stuff that requires the ...
1
vote
2answers
704 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 ...
1
vote
1answer
33 views
An event to be fired on editing a file
As title says, I need an event to fire when a listitems file has been edited.
I appreciate this isn't as simple as it having it's own event, which is why I've tried to make use of the itemupdating ...
2
votes
2answers
2k views
How do I get the url for attachments on an SPListItem using C#?
I have an SPListItem for which I would like to get the urls of all its attachments. The urls will be used as part of my custom web part which has an SPList of SPListItem items.
1
vote
2answers
554 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
3answers
1k views
Item name / title when creating a folder
I am trying to create a list item with a folder content type by setting it's content type id to a folder content type id. The folder is created successfully but the title is set as 1_.000, 2_.000 etc.
...
0
votes
1answer
133 views
Parsing SPListItem is slower than parsing DataRow
I use a SPQuery to get a list of 100 items. I then loop round the list and get the values of the SPListItem
e.g. string name = mySPListItem["Name"].ToString(); (VERY SLOW)
This runs a lot slower ...
1
vote
1answer
142 views
Library ItemUpdating - distinction between versioning of existing files, and changing metadata of existing files
I am currently facing challenges in distinction between updating an item, and creating a new version of same item.
The ItemUpdating eventreceiver is hit in both cases.
Requirements for the library ...
0
votes
2answers
162 views
The impact of BreakRoleInheritance()
I call BreakRoleInheritance on a document (the actual list item) in order to assign someone of less permissions the 'contribute' rights to that particular item. In doing that, have I 'broke' the ...
3
votes
4answers
225 views
Set permissions on an item depending on column value
Is there anyway to set permissions on an item depending on a column value? I was think about creating a feature to do this but do I have to?
1
vote
0answers
280 views
Get last major published version of items returned as DataRow (from SPSiteDataQuery)
Does anyone know the solution for this?
If I'm querying items by SPSiteDataQuery I receive a DataTable with DataRow objects.
I could fetch the current version of an item and check if it ends with ...
1
vote
0answers
61 views
SPListItem.Tasks always empty
I have a custom sharepoint (2007) list (named testlist) on which I attached a test workflow (built with sharepoint designer 2007 and named testwf), which only task defined in the 'Actions' section at ...
0
votes
0answers
87 views
Javascript and DateTime Field
I need to insert a new date in update in a my field.
There's some issus that is better that I know?
0
votes
1answer
111 views
How to delete a specific item from a list
I have writen the following code that should delete some items from a list on the current site, but it must contain some error and it currently doesen't work as expected.
protected void ...
0
votes
3answers
194 views
Change the value of Author field
I am copying over items from one list to another list.
After copying the "Author" field gets populated with "System Account" and so I wish to update some fields in the destination list as follows.
I ...
0
votes
1answer
289 views
selected SPListItem in the current list
how to get the selected SPListItems in the current SPList ?
I thought I would find a helping property like this:
SPListItemCollection mySelectedItems = ...
3
votes
2answers
2k views
Powershell: Update People Picker Field with domain\Username
I'm trying to get this to work in powershell:
$spListItem[$ppField] = "domain\username"
$spListItem.Update()
This gives me the following error:
Exception calling "Update" with "0" argument(s): ...
7
votes
1answer
5k views
How to get a SPFieldLookupValue from an SPListItem?
When you get an SPListItemCollection from a SPList.GetItems(SPQuery) request, and the items have SPFieldUser or SPFieldLookup fields, what is the sexy way to get typed values, not the ...
1
vote
1answer
94 views
difference between item[] and item.fields[]
I want to retrieve let's say the title field of my item so what's the différence between doing these acces methods :
SPList myList = properties.List;
string mytitle1 = ...
0
votes
1answer
133 views
SPFieldCollection TryGetFieldByStaticName bug?
I had expected that if TryGetFieldByStaticName succeeds and returns a value, there would be an SPField in the item that has a static name equal to what I used in the TryGet... call, but no? I.e. can ...
0
votes
2answers
946 views
add value to text field in list with ItemAdded event receiver
i have a textfield in a list, that i want to fill with custom text when a item is being added.
nothing happens when i try to debug it, the breakpoint in the method is never reached.
Please can ...
1
vote
1answer
283 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 ...
0
votes
1answer
126 views
Sharepoint List Event raised when a current view is changed
Is there a event which is raised when current view of a SharePoint list is changed. For example the current view displays all items in the list and now the user selects a different view say Added by ...
0
votes
1answer
174 views
DataformwebPart outside of List folder and ListItemID from another Query string parameter not working
I've tested this before, but I can't seem to get it to work again.
I've got a Doc library with webpart pages. Create a new page and in SPD add a CustomListForm to a custom list in display mode. I ...
0
votes
1answer
939 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 () {
...
1
vote
3answers
931 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 ...
2
votes
1answer
87 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)
...
0
votes
1answer
137 views
How to Get List Values From Sharepoint 2007
I am looking for a way to get list values from SharePoint 2007. Right now I am using PowerShell, and have the following script:
#load Microsoft.SharePoint.dll
...







