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.
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.
- Field = Completed.
- Operator = Equals.
- Value = False.
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.
- Enter Rule Name (e.g. "Complete Checklist Items"). Optionally, enter a description.
- Make sure that the Active checkbox is checked.
- For the Error Condition Formula, enter the following: ISCHANGED(TASKRAY__trCompleted__c) && TASKRAY__trCompleted__c = TRUE && Open_Checklist_Items__c <> 0
- 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."
- Select Error Location.
- Click Save.