I have some code in an event receiver in ItemUpdated that checks for duplicates when an item is updated. I would like to if the item already exists after the changes, the updates are not applied. How do I do this?
properties.Status = SPEventReceiverStatus.CancelWithError; properties.ErrorMessage = "Custom Error Message"; properties.Cancel = true;
Place these 3 lines in a logical block which needs to stop the execution in the item updating event receiver. It will show the custom error message and stop updating.