Questions tagged [event-receivers]

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

Filter by
Sorted by
Tagged with
19
votes
1answer
4k 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
17k 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 ...
11
votes
4answers
31k 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 ...
11
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 ...
11
votes
1answer
3k 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 ...
10
votes
2answers
3k 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?
10
votes
3answers
6k 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
11k 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
4answers
7k 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 ...
7
votes
1answer
620 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 ...
7
votes
1answer
2k views

List event receivers not triggered after quick editing/grid editing

I have a custom Sharepoint 2013 list with event receivers attached to it (adding, updating, deleting). However, it looks like the event receivers are not triggered when the user is adding/editing in ...
6
votes
3answers
2k 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 ...
6
votes
2answers
12k views

Get selected value of dropdown choice list item

I'm trying to get the selected value of a dropdown list item. Nothing works. SPFieldChoice dropdown = list.Fields["Admin Guide"] as SPFieldChoice; var choices = dropdown.Choices; var selection = ...
6
votes
4answers
12k 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 ...
6
votes
1answer
4k views

Add-SPSolution Error An object in the SharePoint administrative framework, "SPSolutionLanguagePack Name=0

When I tried to add my wsp solution I am getting the error, An object in the SharePoint administrative framework, "SPSolutionLanguagePack Name=0 Parent=SPSolution Name=myeventreceiver.wsp", ...
6
votes
1answer
3k 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 ...
6
votes
1answer
176 views

ItemAdded event in Event Receiver

I have created an Event Receiver (Farm Solution) in SharePoint 2016 that triggers when an item is added in Task list. I have exclusively specified the ListTemplateId="107" in Elements.xml. This event ...
6
votes
1answer
4k 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
1answer
9k 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
2answers
332 views

Item deleting not firing from selecting item

Item Deleting event receiver is getting fired when i delete a document from edit form and deleting from Ribbon . But item deleting is not getting fired when i select the list item and try deleting ...
6
votes
2answers
3k 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 ...
6
votes
2answers
1k 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 ...
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
4answers
6k 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?
5
votes
1answer
160 views

SP2013 Event Receiver action open page library\list

I want to create Event Receiver, but I need an event type that would work when opening the library\list page for example. Tell me which event to use? Or is Event Receiver not the best solution?
5
votes
3answers
231 views

Is it totally wrong or should be avoided to create farm solutions inside sharepoint 2013 on-premise

I started a new sharepoint 2013 enterprise server on-premise project for a customer, and on the first phase I want to do the following which requires me to create 2 farm solutions:- I need to add ...
5
votes
4answers
13k 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 ...
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
4answers
207 views

ItemEventReceiver lifetime

When I register an ItemEventReceiver to a List in a SharePoint farm, when & where will it get instantiated, and when & where will its event-handling-methods be called? The options I could ...
5
votes
2answers
325 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
1answer
8k 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 ...
5
votes
0answers
343 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
5
votes
2answers
2k views

How to create SPQuery by filtering date interval

I have a custom aspx form where I retrieve list items by filtering two values EventDate and EndDate. I have a realization but it returns nothing: DateTime eventDate = Convert.ToDateTime(properties....
4
votes
2answers
6k views

Add Event Receiver on two custom lists?

So I have a question: I have an event receiver, that should be hired for a specific list. So I changed the ListUrl property on the elements.xml of the event receiver. But now I need the same event ...
4
votes
1answer
2k views

Does the ItemCheckedIn event fire when item is updated?

I can't find any documentation on exactly when the ItemCheckedIn fires. I know it does when a user explicitly checkes it in, but I thought it would also fire when an item was added, or updated, since ...
4
votes
1answer
537 views

properties.ListItem.Url inside an event receiver is working well for discussion board items, while it fails for custom list (url will end with _.000 )

I am working on an event receiver inside my sharepoint server 2013. now inside the event receiver i use the following html code to build a link to the current item which cause the event receiver to ...
4
votes
4answers
5k views

which one is better considering performance, workflow or event receiver?

Using events like ItemAdded, ItemUpdated which one has the good performance on custom list. What can be preferred considering there are large 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
1answer
1k 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?
4
votes
2answers
270 views

How to stop Update event from firing when adding a document to a library

When adding a new document, both Add and Update events trigger my event receivers. I have an Add and an Update event receiver. Is there a way to avoid the Update event?
4
votes
2answers
348 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
1k 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
1k 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
2answers
4k 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 ...
4
votes
1answer
269 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
4k views

Event manager error: Could not load file or assembly - Solution has been retracted

I have a wsp which basically contains a Workflow and an Event Receiver (Item Updating). I deployed it, and then had to retract the solution. Now I'm getting an error every time I try to update an item....
4
votes
1answer
802 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
281 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 ...