Since TaskRay is a 100% Salesforce native application, the Lightning Process Builder can be used to automate various TaskRay processes.
TaskRay's Baselining feature can be invoked using the Lightning Process Builder. In this article, we will use an example of a rule where a Baseline is created when a Project's progress field reaches 25%, 50%, 75%, and 100% completion.
As you go through these instructions, keep in mind that there are many other possibilities for customizing the process and you can modify the setup to suit the specific needs of your organization.
Step 1: Build the Process using the Process Builder
Create a New Process
- From Setup, navigate to:
- Lightning: Process Automation | Process Builder.
- Classic: Create | Workflow & Approvals | Process Builder.
- Click New.
- Enter the Process Name, API Name, and Description.
- For The process starts when field, select A record changes.
- Click Save.
Select the Object for the Process
The first thing that you need to do is select the object that will trigger the automated process. In this case, we will select the TaskRay Project object, because that is where the initial action will take place (e.g. completion percentage changes).
- On the canvas, click on + Add Object.
- For the Object field, select TaskRay Project.
- Under Start the process, select When a record is created or edited.
- Click Save.
Define the Criteria That Triggers the Process
The next part of building the process is to define the criteria that will trigger the process. In our example, it would be the event of the project reaching a certain completion percentage.
- On the canvas, click on + Add Criteria.
- Enter the Criteria Name.
- Under Criteria for Executing Actions, select Formula evaluates to true.
- In the Build Formula field enter the formula below:
IF( ISCHANGED([TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c) && OR( ( PRIORVALUE([TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c ) < 100 && [TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c =1.00 ), ( PRIORVALUE([TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c ) < 75 && [TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c >=0.75 ), ( PRIORVALUE([TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c ) < 50 && [TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c >=0.50 ), ( PRIORVALUE([TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c ) < 25 && [TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c >=0.25 ) ), TRUE,FALSE)
- Click Save.
Define the Actions that Occur when the Process Runs
Next, you need to define the actions that should occur when the process is fired. In our example, the action that should occur when the process is fired is the creation a new TaskRay Baseline Record. Once Process Builder creates this record, TaskRay will take over and do the rest of the baselining, including snapshots of the Task Groups and Tasks within the project.
InProcess Builder
- On the canvas under Immediate Actions, click on + Add Action.
- For Action Type, select Create a Record.
- Enter the Action Name.
- For Record Type, select TaskRay Baseline.
- Under Set Field Values, select the following on the first row:
- Field = Project
- Type = Field Reference
- Value = Record Id
- On the second row, select the following:
- Field = Notes
- Type = Formula
- Value = enter the following formula: TEXT([TASKRAY__Project__c].TASKRAY__trCompletionPercentage__c *100)+'% complete'
- Click Save.
Activate the Process
- Click Activate.
- In the dialog, click Confirm.
Step 3: Test It Out!
Now see how this works. Go to any TaskRay project and complete tasks to see Baselines automatically create when the progress field reaches 25%, 50%, 75%, and 100%.