Lock Templates for Editing

Optionally, TaskRay Project Templates can be locked down for editing using Salesforce Validation Rules

By setting a restriction on editing templates, you can prevent users from modifying the template project and task details, including checklists and dependencies. In order to set such restrictions, you would need to create validation rules on three TaskRay objects: TaskRay Project, TaskRay Task, and TaskRay Checklist

In the instructions below, the validation rules lock a project in a way that only a System Administrator can edit the templates. However, the same concept can be applied to any object and any user profile by adjusting the parameters of the validation rule.

With these validation rules in place, users with restricted template editing access will still be able to clone the templates to create new projects. The cloned projects will include all of the tasks and checklists, as well as be open for editing by all users.

Note: Setting restrictions on editing templates utilizes user profiles. Therefore, the user profiles that have a restriction on editing templates will also have a restriction on creating templates. 

 

Create a Validation Rule for TaskRay Project Object [Admin]

  1. From Setup, navigate to:
    • Lightning: Objects and Fields | Object Manager.
    • Classic: Create | Objects.
  2. Click on the TaskRay Project object in the list.
  3. In the Validation Rules section, click New.
  4. Enter the name for the validation rule.
  5. Check the Active checkbox.
  6. Optional: Enter description.
  7. In the Error Condition Formula section, enter the following formula: AND(TASKRAY__trTemplate__c = True, NOT($Profile.Name = "System Administrator")) 

    Note: In the formula above, the Profile Name "System Administrator" can be substituted for any other desired profile. The profile that is entered here will be the one that will have access to editing templates with the validation rule in place.
  8. Enter the Error Message that you want to display when the validation rule is triggered.
  9. Select where you want the error message to display (top of page or field). 
In the instructions above, the validation rule locks project editing when the Template checkbox in the Project Details is selected. In addition, it is also defined that the only user that can edit the template project is one with the System Administrator profile name (or whichever profile was specified instead).

 

 

Create a Validation Rule for TaskRay Task Object [Admin]

Repeat the steps above for the TaskRay Task object. 

For step 7, change the formula to: AND(TASKRAY__Project__r.TASKRAY__trTemplate__c = True, NOT($Profile.Name = "System Administrator"))

Note: As with the formula for the TaskRay Project object, you can change the Profile Name "System Administrator" to any other desired profile.

 

Create a Validation Rule for TaskRay Checklist Items Object [Admin]

Repeat the steps above for the TaskRay Checklist Items object. 

For step 7, change the formula to: AND(TASKRAY__Project_Task__r.TASKRAY__Project__r.TASKRAY__trTemplate__c = True, NOT($Profile.Name = "System Administrator"))

Note: As with the formulas for the TaskRay Project and TaskRay Task objects, you can change the Profile Name "System Administrator" in the formula to any other desired profile.

 

Create a Validation Rule for TaskRay Principal Template [Admin]

Repeat the steps above for the TaskRay Principal Template object. 

For step 7, change the formula to:

NOT($Profile.Name = "System Administrator"))

Note: As with the formulas for the TaskRay Project and TaskRay Task objects, you can change the Profile Name "System Administrator" in the formula to any other desired profile.

 

Create a Validation Rule for TaskRay Principal Version [Admin]

Repeat the steps above for the TaskRay Principal Version object. 

For step 7, change the formula to:

NOT($Profile.Name = "System Administrator"))

Note: As with the formulas for the TaskRay Project and TaskRay Task objects, you can change the Profile Name "System Administrator" in the formula to any other desired profile.

 

Was this article helpful?

4 out of 5 found this helpful

Have more questions? Submit a request