Questions tagged [event-receiver]
140 questions
7
votes
3 answers
Getting SPContext inside event receiver
I created an Event Receiver, but the problem is that I can't get a reference to the SPContext: SPContext.Current returns null. I need it to add some lists to the site. Does anyone have an idea of how I could get it?
Also I tried putting break…

Dr.Denis McCracleJizz
- 850
- 2
- 11
- 26
7
votes
2 answers
WebView control with focus blocks media button events in Android 5
Edit May 8, 2016
I found the reason for my troubles receiving media button events in my app. See the answer below. I editid the title of this question to make finding the issue easier. The original title was "What can possibly block media buttons on…

gregko
- 5,642
- 9
- 49
- 76
6
votes
1 answer
Attach EventReceiver to all lists of a sharepoint site
Can we write an eventreceiver that gets fired when any list is updated.
The listtemplateid that we have to specify for an eventreceiver makes our code specefic to one breed of lists. What if we want to have the code execute for events on all lists…

Muhammad Hasan Khan
- 34,648
- 16
- 88
- 131
4
votes
2 answers
SharePoint: Multiple events for single item updated
I have an item event receiver for a specific content type that is used in a Pages library. I am using the event logger to debug it, and I can tell that whenever I edit a page and publish it, it fires 3 ItemUpdating and 3 ItemUpdated events. I am…

Christian P.
- 4,784
- 7
- 53
- 70
4
votes
4 answers
Using an event receiver to update an item's 'Title' field
I have written an event receiver that is activated on the 'ItemAdded' event of a 'Pages' list. The code runs fine, but my issue is this - during the call to my Sub ItemAdded, I want to change the value of a field belonging to the current list item…

Jason Evans
- 28,906
- 14
- 90
- 154
3
votes
3 answers
SharePoint: Error on unregistering an EventReceiver form a ContentType
I've got some problems unregistering some eventreceivers form a contenttype. The contenttype and the receivers were deployed and registered by myself so I don't try to remove any MOSS built-in or internal eventreceivers.
I trying to archive this…

Flo
- 27,355
- 15
- 87
- 125
3
votes
1 answer
Item Adding in event receiver sharepoint 2010
public override void ItemAdding(SPItemEventProperties properties)
{
base.ItemAdding(properties);
SPItem itemBeingAdded = properties.ListItem;
var startTime = itemBeingAdded["Start Time"];
// Some…

Atish Kumar Dipongkor
- 10,220
- 9
- 49
- 77
3
votes
2 answers
Sharepoint : Event Receiver : Item Adding
Anybody used the "ItemAdding" method successfully in an Event Receiver in Sharepoint for validation?
I think it just can't work properly for validation purposes because it seems that :
You can't access the data you just
entered in a form
If you…
mrmuggles
3
votes
2 answers
is it possible to call an event receiver from an event receiver with different properties?
I have an event receiver that runs when metadata on a folder (docset) is updated. In the same event receiver, I want to run kick off an event receiver for each document in the folder. What I want to know is: is it possible to call an event receiver…

joynoele
- 393
- 4
- 16
3
votes
2 answers
Create a folder in document library using Sharepoint event receiver
I am using the following code to create a folder inside my document library. The event get triggered and executed till the last line of my code without any issues. However the folder is not getting created or listed in my document library.
public…

aarpey
- 158
- 1
- 3
- 15
3
votes
1 answer
How to update field value in current item via event receiver?
EDIT: I've realized that my approach in the second code block was unnecessary. I could accomplish the same thing by doing the following in ItemUpdated:
SPListItem thisItem = properties.ListItem;
thisItem.File.CheckOut();
thisItem["Facility…

Josh
- 3,601
- 14
- 50
- 71
2
votes
1 answer
SharePoint DocumentSet Event Receiver ItemAdded isn't firing
I've programatically created ContentType based on document set and want to attach event receiver to it. Looks something like this:
SPEventReceiverDefinition eventReceiverDefinition = TestDocumentSet.EventReceivers.Add();
…

Denis Gursky
- 21
- 2
2
votes
3 answers
SharePoint List Item Event Handlers
I have the following scenario in my SharePoint 2007 project.
I have timer job definition which each 30 minutes updates SharePoint list from the SQL database table.
I also have added item event handler for my list, so it does not allow users to add…

Hrayrd
- 61
- 1
- 3
- 6
2
votes
0 answers
How do I set a custom enterprise field in an OnCreating event receiver within Project Server?
I am trying to set a project enterprise custom field within the OnCreating event of an event receiver within Project Server 2013 on premise. When I debug the code, everything looks to be set correctly but the field is always empty once the project…

Robert V
- 21
- 2
2
votes
3 answers
How to update SPItemEventReceiver assembly version for a list in SharePoint?
We have an SPItemEventReceiver compiled into its own assembly.
We are using STSDev to package up a SharePoint solution with this EventReceiver as a feature. I am not assigning the SPItemEventReceiver to a specific ListTemplateId within the…

Keith Sirmons
- 8,271
- 15
- 52
- 75