Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Manually Assign Therapy Tasks to Users

Manually Assign Therapy Tasks to Users

Make sure stakeholders in a therapy step don’t miss their assigned tasks due to configuration errors. Create a custom field on the Assessment Task object and configure an Apex trigger to assign therapy tasks using criteria-based sharing.

Required Editions

Available in: Lightning Experience

Available in: Enterprise and Unlimited Editions with Health Cloud or Life Sciences Cloud

User Permissions Needed
To define an Apex trigger: Author Apex
To create sharing rules: Manage Sharing
To use assessment tasks: Industries Visit permission set
  1. Create a custom field on the Assessment Task object, with the Text data type.
    1. From the object management settings for Assessment Task, go to Field & Relationships.
    2. Click New.
    3. Select Text as the data type, and click Next.
    4. Enter a field label. The API name is auto-populated.
    5. Add a value for the maximum length of the text field.
    6. Click Next, Next, and Save.
  2. Add to your existing Apex Trigger for the Assessment Task object or, if your org doesn't already have one, create one with these instructions.
    1. Click Gear icon, and click Developer Console.
    2. Click File | New | Apex Trigger.
    3. Enter a trigger name, and select Assessment Task from the sObject picklist.
    4. Delete the auto-generated content and paste this sample content.
      trigger TriggerName on AssessmentTask (before insert) {
       for(AssessmentTask obj: Trigger.new) {
       obj.CustomAssignee__c = obj.AssignedToId;
       }
      }
  3. Create a group of users you want to share the task with.
    1. From Setup, in the Quick Find box, enter Public Group, and then select Public Group.
    2. Click New.
    3. Add a label for your group. The Group Name is auto-populated.
    4. In Search, select Users.
    5. Select the users you want to share a task with and click Add to move them from Available Members to Selected Members.
    6. Save your changes.
  4. Create a criteria-based sharing rule.
    1. From Setup, in the Quick Find box, enter Sharing Settings, and then select Sharing Settings.
    2. In Manage sharing settings for, select Assessment Tasks.
    3. In the Sharing Rules related list, click New.
    4. Enter a label. The rule name is auto-populated.
    5. In Select your rule type, select Based on criteria.
    6. As you’ve created an Apex trigger, you can select the custom field as the criteria. Under Select which records to be shared, select the custom field, and then select EQUALS. Leave the value as blank.
    7. In Select the users to share with, select Public Group, and then select the group you created.
    8. In Select the level of access for the users, select Read/Write.
    9. Save your changes.
 
Loading
Salesforce Help | Article