Here was my approach to yesterday’s task challenge.
I started by creating a custom object called “Task Team”, with a lookup to the User. Using a custom objects allows me to potentially create additional fields, such as “Role” (picklist) and “Primary” (checkbox).
Unfortunately Salesforce doesn’t allow you to have a lookup to the Task. So instead, a field called “TaskId” text(18) was added.
Then I built a screen flow that displayed a datatable. The flow first fetched all active users, and displayed them in the table. It also looked to see if there were any records with Task Team.[TaskId] = current task. If there were, these users were pre-selected in the table.
This meant the user just needed to click the checkbox next to the desired users, and the flow would create or delete the necessary Task Team records. It also concatenated the selected names with a “; ” delimiter and displayed the results in a read-only field on the Task.
A button called “Manage Task Team” was added to the Task, which called this screen flow.
The takeaway
Effectively working around Salesforce limitations is a strong indicator of being a “good enough” consultant. Try to stay as close to out-of-the-box as possible though. This avoids over-engineering a custom solution.