Share via

SPEventReceiverStatus.CancelNoError showing error even when it is not supposed to

Frank Martin 526 Reputation points
2024-10-15T05:01:04.31+00:00

I am developing GroupUserAdding event receiver in which I am using SPEventReceiverStatus.CancelNoError but it is still throwing error "Sorry, something went wrong" when someone tries to add user in group. It is for SharePoint 2016. Here is my code:

Typing from mobile so formatting may not be there.

public override void GroupUserAdding(SPSecurityEventProperties properties)
{
    base.GroupUserAdding(properties);
base.EventFiringEnabled = false;
properties.Status = SPEventReceiverStatus.CancelNoError;
base EventFiringEnabled = true;
}
Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.