1

This question already has an answer here:

I have a user which has only Adding permissions which means that the user can only add items to a list. But I want to implement some logic in Title column with an even receiver.

But the problem is that I cannot update the item due to the permissions issue.

I have tried to use SPSecurity.RunWithElevatedPrivileges as follows but it is not working. I have the following event and code:

public override void ItemAdded(SPItemEventProperties properties)
    {
          SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                base.ItemAdded(properties);
                DateTime data = DateTime.Now;
                string dt = data.ToString("yy");

                properties.ListItem["Title"] = "KPM-000" + properties.ListItemId + "/" + dt;  
                EventFiringEnabled = false;
                properties.ListItem.Update();
                EventFiringEnabled = true;
            });
    }

But this event wont work, it throws an exception AuthenticationException

marked as duplicate by Tiago Duarte, Community Apr 26 '18 at 13:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.