Prevent Tasks from Being Finished Until All Checklist Items Are Completed

This feature is available to the following product editions
  • Starter
  • Standard
  • Premium

In general, if a TaskRay Task that has unfinished checklist items is marked as Finished (moved to the final column in Kanban), those open checklist items remain unfinished.

However, if you would like to prevent a TaskRay Task from being marked as complete when there are still unfinished checklist items within it, you can do so by adding a Salesforce Validation Rule. This customization will ensure that users complete all their checklist items before completing the task.

 

Create a Custom Roll-Up Field [Admin]

The first thing that you will need to do to build this validation rule is create a custom roll-up field on the TaskRay Task object.

  1. From Setup, navigate to:
  • Lightning: Objects and Fields | Object Manager.
  • Classic: Create | Objects.
  • Click on the TaskRay Task object.
  • Under Fields and Relationships, click on New.
  • Select Roll-Up Summary and click Next.
  • Enter Field Label (e.g. "Open Checklist Items"). The Field Name should automatically populate. Optionally, enter Description and Help Text.
  • Click Next.
  • For Summarized Object, select TaskRay Checklist Items.
  • Under Select Roll-Up Type, select Count.
  • Under Filter Criteria, select Only records meeting certain criteria should be included in the calculation. Enter the following in the first row:
    • Field = Completed.
    • Operator = Equals.
    • Value = False.
  • Click Next.  
  • Using the checkboxes, edit field-level security, if necessary. Click Next.
  • Select if you want to add the field to the Project Task Layout and click Save.
  •  

    Create a Validation Rule [Admin]

    Now that the new Open Checklist Items roll-up summary field has been created, the next step is to build out the validation rule. 

    1. Within the TaskRay Task object, scroll down to the Validation Rules section and click on New.
    2. Enter Rule Name (e.g. "Complete Checklist Items"). Optionally, enter a description.
    3. Make sure that the Active checkbox is checked.
    4. For the Error Condition Formula, enter the following: ISCHANGED(TASKRAY__trCompleted__c) && TASKRAY__trCompleted__c = TRUE && Open_Checklist_Items__c <> 0
    5. Click on Check Syntax to verify that there are no errors in the formula.
    6. Enter Error Message. This will be the message that will appear when the rule is enforced (in other words, if someone tries to move a TaskRay Task with incomplete checklist items to the Finished column, he or she will see that error message). Example: "Please finish ALL checklist items on this task before moving it to the Finished column."
    7. Select Error Location.
    8. Click Save.

    Was this article helpful?

    17 out of 19 found this helpful

    Have more questions? Submit a request