You can check the completion of many tasks and prevent the accidental completion of the task.

Example: The Task is to check the Phone number of the account.  The check could be that there is a phone number on the account.  So, if there is no phone number on the account, the user cannot complete the task.


Note: You can also automatically start a flow after the completion of the Task.


User Display

Example: The Call result was entered via Inline Edit, but the Account Phone is empty. When trying to complete the Task, the error message is displayed.

The Timeline component uses the same functionality.


Setup



In the Checklist Item, fill in the field Complete Check, e.g.,

Phone <> NULL : Please provide Phone Number

with the format:  "SOQL where clause" ":" "Optional Error Message"

If you omit the ":" with the optional error message, the where clause is displayed.


The SOQL where clause can be as complex as you like.

In this case, unfortunately, there is no LENGTH() function, but there are workarounds.


We validate the entry using the dynamic SOQL:
"SELECT Id FROM RelatedObject WHERE Id=RelatedToId AND yourWhereClause"
If this query returns no row, the check fails. 


The SOQL is checked when you enter it in the Complete Check field and requires that on the Checklist, you have a single value in the Only for Object(s) field (in this case: Account).


The Complete Check is only performed if the Task Status is set to Completed.

If you set the Status to any other close status, like Aborted/Cancelled/..., the check is not performed.


Note: you may also want to setup the Inline Edit for direct entry.



Checking Task (Activity) Fields

The Checklist Item field Complete Check uses the Task Related To record for the validation.

You can also add additional fields on the Task/Activity to monitor the progress or log details.

For this, fill in the field Complete Check (T), e.g.,

CallDisposition <> NULL : Provide Call Result

with the same format as above.


We validate the entry using the dynamic SOQL:
"SELECT Id FROM Task WHERE Id=taskId AND yourWhereClause"
If this query returns no row, the check fails.