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.
63
questions
3
votes
2
answers
5k
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
4
answers
2k
views
Why does my Event Receiver (sandboxed) not work on Sharepoint Online, but works perfect on premise
using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;
namespace ...
2
votes
1
answer
2k
views
How to restrict user from deleting\editing documents if user is not author of that document
I want to restrict users from editing or deleting others documents, but they can edit/delete there own documents.
In list we get this functionality in advance settings, but in document library it is ...
7
votes
4
answers
8k
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
4
answers
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 ...
4
votes
1
answer
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
1
answer
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 ...
3
votes
1
answer
2k
views
Why Item Updated and Item Added trigger together when we add a item to list (document library)
I have gone through hundred of articles over months but never understood as what could be the reason Item Updated and Item Added trigger together when we upload a item, even though if you try this....
3
votes
1
answer
5k
views
EventReciever to change permissions
I am trying to create an event reciever on a document library that on creation it removes all permissions and gives the author contribute writes. All other users get nothing.
I have the following
...
3
votes
1
answer
515
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 ...
0
votes
1
answer
1k
views
How to enable an Event Handler to intercept upload from email in document library
I have a Document Library with an email associated with the OOTB feature. When I send to the library an email with some attachments, every attachment is stored with one of the OOTB methods (divided in ...
0
votes
2
answers
2k
views
javascript event when a row is updated/changed in a Datasheet view?
Is there any way to catch update/changes in the Datasheet view of a list in JavaScript in SharePoint 2010? I see their are event receivers but nothing in Javascript.
19
votes
1
answer
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
1
answer
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 ...
11
votes
4
answers
18k
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 ...
7
votes
1
answer
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
2
answers
15k
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 = ...
5
votes
4
answers
7k
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
2
answers
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 ...
4
votes
4
answers
6k
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?
3
votes
1
answer
610
views
How to copy data from one column to another column(separate list) while adding the item using EventReceiver?
I have created a sharepoint list named "test" in that I have a column URL as multiline text.While inserting data into that column need to update the same value in another list. I tried by adding event ...
3
votes
2
answers
2k
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
2
answers
523
views
Access denied while creating content database from event receiver
I have created one timer job which will add SharePoint content database.
When I am running timer job manually from central admin, Content database is being created successfully.
Now I have one list ...
3
votes
2
answers
4k
views
There was no endpoint listening - AppEventReceiver
I'm developing provider-hosted SharePoint 2013 App with Windows Azure as a backend. I created an app event receiver to fire when app is installed. When i publish my Web App (.NET MVC4) to Azure, ...
2
votes
1
answer
1k
views
Manage Multiple ItemUpdating Event Receivers On List
I have a requirement to multiple Event Receivers targeting Custom List (100) that fire on the ItemUpdating method.
For one of the Event Receivers the requirement is to check that there are no related ...
2
votes
2
answers
869
views
Error with site collection daily resource usage quota
Recently I've added an event receiver to a sandbox feature, but since I added it, whenever I try to deploy the feature, I always get the message
Error occurred in deployment step 'Add Solution': ...
2
votes
1
answer
228
views
Item still deleted when click on OK in ItemDeleting event CancelWithError
public override void ItemDeleting(SPItemEventProperties properties)
{
try
{
properties.Status = SPEventReceiverStatus.CancelWithError;
properties....
2
votes
2
answers
6k
views
Cancel event while ItemAdding
I am just trying to cancel the default behavior of event when adding Item
public override void ItemAdding(SPItemEventProperties properties)
{
try
{
//my code
...
2
votes
1
answer
121
views
ItemUpdating event receiver method yielding COMException in MOSS 2007
I implemented an event receiver and attached it to a MOSS 2007 document library. I overrode the synchronous itemUpdating method and perform some validation before letting the update operation proceed. ...
2
votes
1
answer
1k
views
Show Item Level Permissions in Column [C# - SharePoint 2013]
I'm trying to show all Item level Permissions in a SharePoint list Column.
I already solved this using PowerShell, however it was so slow to run sequentially, I've decided I need a C# Solution:
I ...
2
votes
1
answer
4k
views
ItemUpdating not saving field values
A user has a list that has a couple fields that are often updated. He wants to store the prior values in some other fields on the item when the item is updated (yes, I know versioning would be easier,...
2
votes
2
answers
1k
views
Dispose of SPItemEventProperties at the end of an event receiver?
Is there any need to call
properties.Dispose();
at the end of an event receiver? Would this prevent memory leaks? Is this unnecessary? Is it best practice?
2
votes
1
answer
436
views
SPListDataValidationException in an event receiver on a task list with Overdue tasks
I have a task list called Finance Department Tasks on this task list i have created an item updating event receiver which checks if all fields in the task list are filled and then sets the task status ...
2
votes
2
answers
1k
views
SharePoint event receiver ItemUpdating event behaves differently when a list item is updated through Workflow
I am having a SharePoint custom list which is having a designer workflow and event receiver attached to it.
In the event receiver on ItemUpdating event I am having the below code to check if a ...
2
votes
1
answer
2k
views
Event receiver not firing on item added via email
I have a list that have been configure to receive incoming email. I also create event receiver for that list (on itemAdded and on itemAdding).
The problem is, my event receiver not executed when ...
2
votes
1
answer
1k
views
SPListItem.Update() not firing ItemUpdating
I'm updating item in SPListItemCollection using SPListItem.Upadte() but my event receiver is not receiving ItemUpdating/ItemUpdated events (breakpoints are not hit on either handlers).
Sample code ...
2
votes
1
answer
2k
views
Sending an email using sharepoint object model sharepoint 2010
i have been working on generating email in an event receiver using share point object model..i used the sputility.sendemail method..2 things are necessary in the email(email from and HTML body)..so i ...
2
votes
1
answer
1k
views
Add choice to SPFieldChoice from an Eventreceiver in sandboxed
I am trying to make a sandboxed solution that adds a couple of itemeventreceivers to a list, that add the items to the choices of a choicefield. The result would be something like a lookup field, ...
1
vote
1
answer
11k
views
Change name in ItemAdding event receiver or create a new Item
I have several custom folder types such as Year Folder or Quarter Folder. When the user creates a folder of this type he enters the name and selects an item from a dropdown (year etc.). 90% of the ...
1
vote
4
answers
3k
views
Debugging sandboxed ItemUpdated event receiver - breakpoints not hit
I'm trying to debug an ItemUpdated event receiver in SharePoint 2010. I add breakpoints to the code, and hit F5 in Visual Studio 2010. I click Attach when I'm prompted to attach to the process. Then, ...
1
vote
2
answers
899
views
deploy a list with specific item-level permissions in ListAdded event receiver method
I have a certain type of custom list I have designed in my 'solution.wsp', that, whenever an instance of it is instantiated, it should have at the outset a specific Item-Level permission.
To further ...
1
vote
3
answers
3k
views
Add item to list anonymously (not as anonymous user)?
I have a requirement that authenticated users should be able to anonymously add items to a list, i.e. they are authenticated but the Created By/Modified By field should not display their name. I could ...
1
vote
1
answer
356
views
What are the differences btw "properties.Web.CurrentUser;" & "web.Users.GetByID(properties.CurrentUserId);" inside my Event Receiver
I added the following Event Receiver inside my sharepoint server 2013:-
1. Using VS >> add a new Event Receiver >> Type "List Item Events" >> when "item was created".
2. the idea of the event receiver ...
1
vote
2
answers
3k
views
How to use SharePoint notification from Event Receiver
I have an event receiver, which fires when item is being deleted ( ItemDeleting event ). I have some logic that checks whether item can be deleted or not, and if it can't, I need to show notification ...
1
vote
1
answer
373
views
ItemAdded not firing with REST
I have an ItemAdded on a list which creates a Document Library for each item added, and updates some fields of the item.
It fires perfectly when items are entered manually.
It doesn't fire when ...
1
vote
1
answer
1k
views
Setting custom field default value within ItemAdded event
my aim is to use a Sharepoint 2013 Foundation this way:
define a template Document Library, ProjectTemplate
define a list of projects, with a "category" column
an itemAdded event receiver on the ...
1
vote
1
answer
442
views
Programmatically changing a field won't trigger the event receiver
I have a console application that updates an item's field. The field is updated but it doesn't fire the event receiver attached to itemupdated. The same receiver fires when the item is updated inside ...
1
vote
1
answer
402
views
Default SPEmailEventReceiver: Object reference not set to an instance of an object
I'm trying to write a new Email Event Receiver for an email-enabled document library. When my feature is disabled, email is delivered successfully to the library. When my feature is enabled, this ...
1
vote
4
answers
7k
views
How can I call a custom JavaScript function after a form has validated?
I have a form for submitting events to our calendar. What I want is to call a function once the form has validated. Something like this:
User edits item
User clicks save button
Form validates ...
1
vote
1
answer
135
views
Copy a file content using event receivers?
I want to know if there is any way by which I can make a copy of the file which is being added to a document library using c# event receiver and further convert it to pdf in SharePoint 2010 ?
i.e If ...