Prevent Tasks from Being Finished Until All Checklist Items Are Completed

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.

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 (in Salesforce) 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.

Within the TaskRay Task object, scroll down to the Validation Rules section and click on New.

Click on Check Syntax to verify that there are no errors in the formula.

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."