sharepoint - SPItemEvent: abort the event from the EventHandler -
how can abort item (in case, itemdeleting) doesn'r executed? want deletion not take place if conditions matched , silently use (no messages, no exceptions). thanks
edit: sp 2010
public override void itemdeleting(spitemeventproperties properties) { properties.cancel = true; properties.errormessage = "something went wrong!"; }
if cancel though, reported user, nothing can that.
update
for use status property
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventpropertiesbase.status.aspx
public override void itemdeleting(spitemeventproperties properties) { properties.status = speventreceiverstatus.cancelnoerror; }
Comments
Post a Comment