How can I prevent users from deleting sharepoint task list item? Should i override the ItemDeleting event or is there any other site level options available to achieve the same?
You could also set up a custom permission level out of the box.
I would recommend using the existing "Contribute" permission level as a guide and just uncheck the "Delete Items" list permission. Then, you can give your users that permission to the list.
You can use List Item Event Receiver, ItemDeleting method:
public override void ItemDeleting(SPItemEventProperties properties)
{
properties.ErrorMessage = "User don't have permission";
properties.Cancel = true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With