Event Receivers are a piece of managed code that responds to SharePoint events when specific triggering actions occur on a SharePoint object.

learn more… | top users | synonyms

14
votes
1answer
3k views

Is Calling base.ItemUpdating(properties); necessary?

In an event receiver, is it necessary to call base.ItemAdding(properties);, base.ItemUpdating(properties);, etc. at the beginning of your event handler? I've seen people arguing that it isn't ...
11
votes
4answers
15k views

Creating a Site collection programmatically throws exception <nativehr>0x80070005</nativehr>

I'm migrating a SharePoint customization from MOSS 2007 to SharePoint Server 2010 (Win 2008), which creates the Site Collection programmatically. Problem is I'm unable to create the Site Collection ...
10
votes
2answers
2k views

What is the difference between properties.OpenWeb() and properties.Web?

I am developing an event receiver, using the ItemUpdating event, and I noticed that the properties parameter has an "OpenWeb" method, with this description: Retrieves the Web site that is ...
8
votes
2answers
2k views

Event Reciever on specific list in sharepoint 2010

I am working on creating event reciever for a custom list in sharepoint 2010 using visual studio..how can this event reciever be targeted to a specific custom list ..in my case its customEmpList?
8
votes
4answers
28k views

Error occurred in deployment step 'Activate Features': <nativehr>0x80070002</nativehr><nativestack></nativestack>

I have a feature. On the FeatureActivated event I am creating a list if it is not there. I also have an EventReceiver that in the elements.xml on the Receivers node has the attribute ListUrl. This is ...
8
votes
1answer
2k views

Client Object Model SystemUpdate

I need to have the SystemUpdate functionality from the Client Object Model. Is there any way I can do it since the ListItem.SystemUpdate() does not exist? Another solution would be to disable the ...
8
votes
3answers
5k views

Workflow and EventReceiver execution order

I have an event receiver, and I'm capturing the "ED" events (Added, Edited). I also have a Workflow on the list that is triggered on Item Added and Updated. Does the workflow get called before the ...
7
votes
4answers
10k views

Race condition in SPListEventReceiver.ListAdded - Save Conflict

I am currently developing an Event Handler for SharePoint 2010 which sets defaults for Document Libraries on creation (content types, version settings etc). I am having a problem with Save Conflicts ...
7
votes
1answer
379 views

How to know if another event / user is running on an SPListItem (Sharepoint 2010)

I have a Sharepoint 2010 farm in which is deployed my solution. This solution provides some "data mantain" of some content types. Let me explain: Suppose I add a file in a document library: when I ...
6
votes
1answer
8k views

How to get a field value of the item in ItemDeleted event handler?

I need to get the value of ListItem field in ItemDeleted event handler. Only value of one numeric field. But properties.ListItem == null. And AfterProperties, BeforeProperties also do not work. Is ...
6
votes
1answer
2k views

SPListItem.SystemUpdate(false) is still triggering alerts

Environment: SP2010 Enterprise, VS2012, c#, full server access Simple question... I'm using a console app to create sub-folders in a document library based on user input, then calling SPListItem....
6
votes
2answers
2k 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 ...
6
votes
2answers
2k views

Programmatically determine when Approval workflow has completed

I have a list with 2x declarative approval workflows associated with it (the workflows themselves are copies of the OOTB Approval workflow and were built in SharePoint Designer 2010). FYI: The ...
5
votes
2answers
3k views

Event Receiver behaving unexpectedly

I have created a list item event receiver(ItemUpdated). When a item is updated in a list(for which event handler is attached),my code updates other items (may be more than 1) in lists in subsites. ...
5
votes
1answer
2k views

Unable to find Event Receiver template in Visual Studio 2012

This would probably be right under my nose but I am having a hard time finding it. I am trying to create an event receiver in Visual Studio 2012. From this video in YouTube I gather that in Visual ...
5
votes
2answers
1k views

Instantiating SPListItems in Event Receivers - Best Practices

In the MSDN article Best Practices with Event Receivers it is clearly stated: Do not instantiate an SPWeb, SPSite, SPList, or SPListItem object within an event receiver. The article goes on to ...
5
votes
2answers
319 views

How to add style library event receivers?

how can I add an event receiver to the style library ? (can't find any templateid)
5
votes
2answers
653 views

Does Updated event always fire after Added event?

I have an interesting question about event receivers. I have long running ItemAdded event. But as soon as item is saved, another or the same user can edit it, even before async event finished. The ...
4
votes
3answers
5k views

How to add event receivers to all the lists in a site collection?

What is the best practice around adding event receivers across all the lists in a Site Collection?
4
votes
3answers
9k views

Event Receiver, Before and After properties

In an event receiver, Item Was Updated. I want to Compare the Moderation status on ListItems to perform some functionality.This is just some of the code. SPList list = web.Lists["DocLib"]; SPListItem ...
4
votes
4answers
4k views

Event Reciever ItemAdded fired twice

I'm trying to do some treatement after creating an item but the treatement is done twice because in my code after creating the item, I'm updating it , so the event reciever get fired twice: first when ...
4
votes
4answers
8k views

Get list of event receivers registered for a list created from a list definition

I created a list definition created from visual studio. I also have an event receiver specified along with the listtemplate feature. The idea was to have event receiver registered for all lists ...
4
votes
4answers
2k views

Event Receiver called multiple times

I attached an event handler for ItemAdded to a content type A in the xml (using XmlDocuments). I have 4 other content types A1, A2, A3 and A4 that inherit from content type A (in their xml definition ...
4
votes
2answers
78 views

How to check where 'SPEmailEventReceiver' is attached?

I created a simple event receiver of SPEmailEventReceiver. But while creating it, Visual Studio did not ask me on which list/library it needs to be attached. In PowerShell I know that I can get event ...
4
votes
1answer
858 views

Farm scope Event Receiver

For some security reasons on one of our farm level solutions, we need to limit some actions using Event Receiver-FileMoving event. However, as known, event receivers can be deployed only by Site or ...
4
votes
1answer
936 views

ItemUpdating event not firing on folder rename w/ Windows Explorer

I have an Item Updating event receiver that needs to fire when a document library folder is renamed. Everything works perfect when a user renames the folder with the SharePoint UI. However, if ...
4
votes
1answer
142 views

Synchronous ItemAdded event. Do I need to explicitly call properties.Dispose()?

We have a SharePoint 2010 On-Prem solution. I have an ItemAdded event receiver which has been made synchronous using the Synchronization property. Now, when this event receiver fires, I have used the ...
4
votes
1answer
683 views

ApplyWebConfigModifications caching issue

Doing some testing of adding multiple configuration settings during a feature activation. One of my trials caused an error with a setting, specifically around preCondition statement for system....
4
votes
1answer
1k views

WebProvisioned event receiver is firing twice

I am creating a SharePoint site from code behind using SharePoint object model. In the WebProvisioned event, I am creating the groups, enabling a few features. Everything is working fine, except the ...
4
votes
1answer
7k views

Feature activation error: System.InvalidOperationException: Operation is not valid due to the current state of the object

i have taken one List Email event receiver(Type is EmailReceived) and that event receiver attach with document library. when i am activate that feature got error. i have check on ULS Viewer. error ...
4
votes
1answer
264 views

ItemUpdating method for an item event reciever is called three times

I've created an asset library for holding pictures and I've created an event reciever for the ItemUpdating event. When the item is updated, the method is called three times. I've noticed that two of ...
4
votes
2answers
2k views

Webprovisioned not fire

I have a code from external developer that creates site in list event receiver. public override void ItemAdded(SPItemEventProperties properties) { bool EventFiringEnabledStatus = ...
4
votes
0answers
76 views

Workflow doesn't fire when new item is created through Event receiver

When new item is added through event receiver in a list, I have OOTB workflow on item created on that list. But unfortunately it doesn't works. Any help would be appreciated. Thanks
3
votes
6answers
2k views

Logged in user name in SharePoint 2010

I am trying to retrieve the display name('firstname lastname') of a user who logs in the SharePoint site. When I log into my SharePoint site I could see at the top right --'domain/user name'. So when ...
3
votes
3answers
205 views

When to use Server side event receivers Versus using Remote event receivers?

I read a long article about two types of event receivers inside SharePoint server 2013:- Server side event receivers (available inside SP 2013 & SP 2010) Remote event receivers(available inside ...
3
votes
1answer
3k views

Event Reciever run with elevated previledges

I created one event receiver and deployed it, but only users who are site collection admins are able to view this web part. I have included the SPSecurity.RunWithElevatedPrivileges but the same thing. ...
3
votes
3answers
363 views

Why is my app's UninstallingEventEndpoint never invoked during app removal?

I have a Provider-Hosted SharePoint app with an appmanifest.xml that looks something like this: <Properties> <Title>My app title</Title> <StartPage> ~remoteAppUrl/home/...
3
votes
1answer
844 views

Is it possible to wait until my file is uploaded in document library?

I have created a document library and I have applied an Item Added event receiver to that library which will copy that file to another library and I have added that library as a mapped drive to my ...
3
votes
1answer
107 views

Deploy/bind event receivers to lists in single feature

I need to develop and deploy an event receiver (A) to a specific document library <1> and another event receiver (B) to another specific email-enabled document library <2>; both document ...
3
votes
2answers
571 views

Best practice for autonumber

What is in SharePoint 2013 on premise the best way to create an autonumber system? It's for an expense note system and it should be nice to have something like 2014/0001. I know there are different ...
3
votes
2answers
1k views

Attach an event receiver to profile property update

Do someone know if it's possible to attach an event receiver to profile updates? The goal would be to update an external system (such as a CRM) when a user is updating his profile.
3
votes
2answers
839 views

SPQuery - Which fields (ViewFields) are required to Update the list item?

In an SPQuery, which fields are required to update a list item? SPQuery query = new SPQuery(); query.Query = @" <OrderBy> <FieldRef Name='ID' Ascending='true' /> </...
3
votes
3answers
619 views

Add file watermark as it's uploaded

I've been trying to add a watermark to files as they are uploaded to SharePoint. I tried using several events: ItemAdding, ItemUpdating, ItemCheckedIn. In ItemUpdating and ItemCheckedIn the file is ...
3
votes
1answer
333 views

Event receiver in SharePoint 2010

I am working on creating an event receiver. Does SharePoint have a stipulation that the event receiver should be a farm solution or a sandbox solution?
3
votes
2answers
78 views

Programmatically create a ContentDatabase C# SP2013

I am searching for a solution of my problem. I banged my head for the last few hours and tried several things and solutions found on google or stack-exchange. The database should be created via Event ...
3
votes
2answers
813 views

Can the ItemAdding event be used in a Sandbox?

Can the ItemAdding event be used in a Sandbox? I need to perform a task when a Item is a added/adding, it has to be synchronous (item added is async so i cant use that). If i cant use the ...
3
votes
1answer
970 views

How to remove duplicate EventReceiver entries

Lately i had a bug that time-to-time added duplicate event receiver entries in SPEventReceiverDefinitionCollection. So how do i easily enumerate and remove these duplicate entries?
3
votes
1answer
236 views

Files moved with SPFile.MoveTo require a full crawl to be searchable

We've got a problem in our search-driven document management system, and I'm running out of ideas. A custom event receiver, on ItemUpdated() checks to see if the files metadata requires it to be ...
3
votes
2answers
3k views

Event Receiver on SharePoint-hosted Apps

Is it possible to create event receiver or workflow on SharePoint-hosted apps in SharePoint 2013? I have not much knowledge about SharePoint apps. If yes then how to create it... Can we use Remote ...
3
votes
2answers
2k views

Using the ItemAdding EventReceiver to update multiple fields based on values from one field

I have a custom SharePoint 2010 SPfield of type SPFieldMultiColumn. The data in this column is stored in a delimited string, which is parsed and rendered in a readable format in most areas (list view, ...