[SalesForce] Enabling Editing/Deleting others’ Tasks without “Modify All”

Use Case

My users are primarily Service users. They all have Read/Write access (through sharing rules) on all Cases, Contacts and Accounts that they deal with. They collaborate on data grooming – often editing each others' Tasks, Cases, etc. in cases of errors or deleting duplicates.

They need a way to edit a Task that someone else created and that is assigned to a third user.

What I've done

So I read through the documentation and came across the tidbit below, and assigned "Modify All" on Case and Contact to my users. It works.

How to improve it

But I don't like giving such a huge sledgehammer permission away. Though they should be able to modify the Contacts and Cases they have access to, they should absolutely not be allowed to modify or even view some Contacts/Cases that are owned by other teams.

(This is closely related to Providing delete access to records of other users without 'Modify All')

The answer above suggests assigning the tasks to a queue of all of these users, but Tasks cannot live in a Queue. Is there an alternative, where I can assign a task to a person, and allow their colleagues to delete/edit it?

You can edit or delete an activity (in Salesforce Classic only) when
the following applies:

  • You have the “Edit Tasks” and “Edit Events” permissions

  • AND:

    • You’re assigned to the activity, or
    • You’re above the user assigned to the activity in the role hierarchy, or
    • You have the “Modify All” object-level permission in the related record, where the record’s sharing model is “Controlled By Parent.”
      (with Shared Activities enabled, you need the “Modify All”
      object-level permission for at least one contact and the related
      record), or
    • You have the “Modify All Data” permission

Best Answer

There's no general "configuration-only" solution to this problem. You'll need a way to bypass sharing to allow deletion. Here's some choices (some of which are already noted in the comments):

Custom REST/Web Service

Write a "webservice" method, or a @RestResource method. Use "without sharing" to bypass sharing on the tasks.

Visualforce

Write up a page that allows deletion of a specified task. Works the same as above, but uses Visualforce instead of JavaScript.

Trigger

You can actually delete a record in a trigger using "after update". Just make a custom checkbox and have the trigger delete the record when checked. Users will only be able to delete tasks they can edit using this method.

Related Topic