1

User is getting "There's a problem saving this record. You might not have permission to edit it, or it might have been deleted or archived. Contact your administrator for help." exception for a record.

Scenario: User is trying to delete the record which is created by any other user. The object is set with Public Read/Write org-wide sharing settings and the user is assigned with Read/Create/Edit/Delete permission for the object through permission set.

Problem Statement: User is getting above mentioned error while trying to delete the record created by another user. And this exception is not even firing the trigger to debug more.

P.S. Only with "Modify All" access users are able to delete the records but it is not recommended to provide this permission to the users other than system admin.

Thanks in advance for the input.

  • check your role. i think they prevent this by using role hierarchy – cloudZigZag Jan 24 '19 at 11:42
  • @cloudZigZag Role hierarchy has not been set up for the Org. – Yogesh Rawal Jan 24 '19 at 12:32
0

There are only two possible ways wherein you can delete a record which is not owned by you and has OWD as public read/write.

  1. The user trying to delete the record is higher in the role hierarchy than the owner of the record. (i.e. should be in the same branch in role hierarchy)
  2. The user trying to delete the record has "Modify All" permission on that object or has "Modify All Data" permission on profile/permission set.
| improve this answer | |
0

Role hirarchy is necessary to delete the record with "Delete" permission on profile / permission set + "Read/write" as OWD on that object.

If you don't want role hiererchy enabled for that object then you should have OWD "Read/Write" + "Modify All data" permission

If you want to give the permission through permission set then

  1. create a custom permission and set the value to true in your existing permission set.
  2. Create a custom button with Apes + VF/Lightning
  3. In Apex code if the current user has that permission set assigned if so delete the record through apex.
| improve this answer | |
  • Role Hierarchy is not enabled for the org. Is there any other way around? I just checked even with Sharing rule it is not possible to achieve this. – Yogesh Rawal Jan 24 '19 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.