Since TaskRay is a 100% Salesforce native application, the Lightning Process Builder can be used to automate various TaskRay processes.
The Stitcher allows you to combine template projects and task groups to build new projects or modify existing ones. Using the Process Builder, you can automate the Stitcher functionality to automatically create or modify projects when something happens in Salesforce.
In this article, we will use the example of closing (and winning!) an opportunity for an existing account for an upgrade, which would then automatically stitch together a new project in TaskRay to provide the customer the proper onboarding process. Because this is not an outright new customer, we will need a custom-built project in TaskRay to make the onboarding process tailored to this specific use case. Fortunately, the combination of the Stitcher and the Process Builder allows us to do that automatically after such an opportunity is Closed Won.
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.
If you would like to learn how to automatically stitch together tasks, see this article: Automatically Stitch Tasks Using the Process Builder.
Step 1: Set Everything Up in TaskRay
Create Templates
The first step of the process is to make sure that you have all the necessary templates, or in this case building blocks, in TaskRay. You can learn more about creating templates here.
It is up to you how you want to keep the templates organized, but for this example, the first thing that you will need to do is make sure that you have a basic template project in TaskRay for customer onboarding, which will be used as a base for the new project. This can either be an empty template project, or it can contain some generic onboarding tasks that will apply to all onboarding processes, regardless of the circumstances.
Next, create another template containing task groups that are specific to different types of opportunities. To keep things simple, we will refer to the four standard Opportunity Type picklist values to create unique task groups with different tasks for each one. For example, by default, the Type field contains the following values: New Customer, Existing Customer - Upgrade, Existing Customer - Downgrade, Existing Customer - Replacement. In TaskRay, you could create a template project containing unique task groups for each of the values.
For our example, we will only need the Existing Customer - Upgrade template task group and the base project. In other words, we will use the Stitcher to combine the New Customer Onboarding base template project with the Existing Customer - Upgrade template task group.
Note: Type is a standard picklist field on the Opportunity object. If you do not use this field, you can set up the process using a different field and criteria.
Step 2: Build the Process using the Process Builder
Now that TaskRay is all set up and you have all the building blocks to stitch together a project, the next step is to build the actual automated process.
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 Opportunity object, because that is where the initial action will take place.
- On the canvas, click on + Add Object.
- For the Object field, select Opportunity.
- 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 act of changing the status of an Opportunity with Type = Existing Customer - Upgrade to Closed Won.
- On the canvas, click on + Add Criteria.
- Enter the Criteria Name.
- Under Criteria for Executing Actions, select Conditions are met.
- Under Set Conditions, select the following:
- Field = [Opportunity] Stage
- Operator = Equals
- Type = Picklist
- Value = Closed Won
- Click on + Add Row and select the following:
- Field = [Opportunity] Opportunity Type
- Operator = Equals
- Type = Picklist
- Value = Existing Customer - Upgrade
- Under Conditions, select All of the conditions are met (AND).
- Click on Advanced to expand additional settings and select the Yes checkbox.
- This means that we want to execute this action only when the specified changes are made to the record. In our case, we want the action to fire only when the Opportunity status is changed to Closed Won, but only when the Opportunity Type is Existing Customer - Upgrade.
- 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 of a new project via stitching of the New Customer Onboarding - Base template project and the Existing Customer - Upgrade template task group. For this purpose, we will need the record IDs of the New Customer Onboarding - Base template and Existing Customer - Upgrade template task group.
Get Template IDs
- In a new tab, open any Salesforce page.
- Using the Salesforce Global Search, locate the New Customer Onboarding - Base template project. Click on the search result to select it.
- This will open the template in the standard Salesforce interface. Here, we will need to make a note of the record ID, which will be part of the URL. In the browser address bar, highlight and copy the record ID, which will be listed after "salesforce.com/".
Note: If you are in Lightning, the record ID will be followed by "?isd...", which is not part of the record ID. Do not copy it for this purpose. - Repeat the steps to get the record ID of the Existing Customer - Upgrade template task group.
Return to Process Builder
Return to the Process Builder tab in your browser.
- On the canvas under Immediate Actions, click on + Add Action.
- For Action Type, select Apex.
- Enter the Action Name.
- For Apex Class, select Stitch a TaskRay Project.
- Under Set Apex Variables, click on + Add Row and select the following:
- Field = New Project?
- Type = Boolean
- Value = True
Tip: If you were adding a stitch to a live project, you would select False for this row and then add a new row with Existing Project Id option selected. However, in our example, we are creating an entirely new project.
- Click on + Add Row and select the following:
- Field = New Project Template Id
- Type = ID
- Value = < enter the ID of the New Customer Onboarding - Base template that you got in the previous section >
Tip: This row specifies the ID of the "base" template project that is used for stitching in additional task groups.
- Click on + Add Row and select the following:
- Field = New Project Schedule Mode
- Type = String
- Value = Start
Tip: This row defines how the new project will be scheduled. In this case, we will be using the first task in the project for scheduling. End refers to the last task in the project, and Milestone allows to specify a milestone (ID) to be used for scheduling.
- Click on + Add Row and select the following:
- Field = New Project Date Target
- Type = Reference
- Value = [Opportunity] Close Date
Tip: This row sets the date that will be used for scheduling the project. In our example, we are using the first task in the project for scheduling and we are associating it with the Close Date of the Opportunity.
- Click on + Add Row and select the following:
- Field = New Project Name
- Type = Reference
- Value = [Opportunity] Name
Tip: This row defines how the new project will be named. In our example, we will simply use the Opportunity Name as a reference. However, you can get as creative as you want and even build a custom formula.
- Click on + Add Row and select the following:
- Field = Task Group 1 Id
- Type = ID
- Value = < enter the ID of the Existing Customer - Upgrade template task group >
Tip: This row adds the stitch: the template task group. In our example, it is the Existing Customer - Upgrade task group that we created earlier.
- Click on + Add Row and select the following:
- Field = Task Group 1 Schedule Mode
- Type = String
- Value = Start
Tip: This row defines how the stitched in task group will be scheduled. For this example we will be using the first task in the task group.
- Click on + Add Row and select the following:
- Field = Task Group 1 Target Date
- Type = Reference
- Value = [Opportunity] Close Date
Tip: This row specifies on which day the specified task in the stitch will be scheduled on. In our example, we will keep it simple and schedule the task on the same date as the project: Opportunity Close Date. However, you can customize this and even build a custom formula.
- Click Save.
- Click Activate in the top right corner.
Step 3: Test It Out!
It's time to see how all of this works together. Go to the Opportunity record with the type Existing Customer - Upgrade that you want to mark Closed Won and change its status to Closed Won. Now, go to TaskRay to see if the new Customer Onboarding project has been created.