Since TaskRay is a 100% Salesforce native application, the Lightning Process Builder can be used to automate certain TaskRay processes. Here are a couple of examples of what you can do with TaskRay + Process Builder:
- Automatically create a Customer Onboarding TaskRay Project from a saved template when the Opportunity is marked as "Closed Won" in Salesforce.
- Automatically create a Sales Activity TaskRay Project from a saved template when a new Opportunity is created in Salesforce.
- Automatically create a Webinar Prep TaskRay Project from a saved template when a new active webinar campaign is scheduled.
- Automatically complete checklist items when a task is finished.
- Auto-archive TaskRay Projects when they are 100% completed.
Although there are many other different ways that the Process Builder can be used for TaskRay, the example that we will focus on in this article will show how to automatically create TaskRay projects when you close (and win!) opportunities in Salesforce. These instructions should give you a general understanding of how to use the Process Builder with TaskRay, but you can further modify the criteria and build automated processes that are most helpful for your organization.
Step 1: Set Everything Up in TaskRay
Create a Customer Onboarding Project Template
First things first, for the example that we are using, it is important that a Customer Onboarding template project is created in TaskRay. Keep in mind, depending on what you are trying to automate, this step might not be applicable.
You can read more about creating templates here.
Add the Account Lookup Field to the Project Details Layout
In our example, when an Opportunity is Closed Won in Salesforce, we want a new Customer Onboarding project to be created in TaskRay. It is a good idea to also link the new Customer Onboarding project to the Account that is related to the closed Opportunity. To do so, you would need to add the Account lookup field to the Project Details layout by modifying the field set. Follow the Modify Fields Displayed on Project or Task Details instructions to do so.
In terms of the process itself, we will set up the process in a way that will automatically populate the Account field on the Project Details of the cloned Customer Onboarding project. Keep in mind, in order for this field to populate in Project Details, the Opportunity must be linked to an Account.
Step 2: Build the Process Using the Process Builder [Admin]
Now that TaskRay is all set up, 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.
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 the Opportunity 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
- 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.
Define the Actions that Occur when the Process Runs
Next, you need to define the actions that should occur when the process is fires (Opportunity stage changes to Closed Won). In our example, the action that should occur when the process is fired is the clone of the Customer Onboarding template that will create a new project for the closed Opportunity. For this purpose, we will need the record ID of the Customer Onboarding template.
- In a new tab, open TaskRay.
- Locate the Customer Onboarding template and open its Project Details (double click on the template project name in the left sidebar).
- In the Project Details, in the header, click on the Template Project Name.
- This will open the template in a new tab 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.
- 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 Clone a TaskRay Project.
Tip: If you wanted to only clone a task (vs. cloning an entire template project), you could select Clone a TaskRay Task in this section.
- Next, we need to define the source that triggers this clone as well as the Customer Onboarding template, which we are cloning. Under Set Apex Variables, select the following:
- Source Object Id line:
- Type = Reference
- Value = [Opportunity].Id
- Template Project Id line:
- Type = ID
- Value = <record ID of the Customer Onboarding template (from Step 4)>
- Field = Project Name
- Type = Formula
- Click on Build a formula...
- Field = [Opportunity] Name
- In the formula text box, type in + after [Opportunity].Name
- Type in ':Onboarding' (or any other verbiage) after the +
- Click Use this Formula.
- Field = 1. Map Source Field
- Type = String
- Value = AccountID
- Field = 2. To Project Field
- Type = String
- Value = Account__c
Note: The 'Map Source Field' / 'To Project Field' variable can only be used once in the Apex cloning action. If you would like to map additional fields, you would need to create a new "Update Records" action and update specific fields within that action. Please reach out to email@example.com if you need further assistance with this.
- Field = Starting Date of First Task
- Type = Reference
- Value = [Opportunity] Close Date
Tip: If you want the first task of the project to start a certain number of days after the Close Date of the Opportunity, then select Formula instead of Reference and create a formula: Opportunity Close Date + 1 (or however many days from the close date you'd like the task to start).
Step 3: Test It Out!
It's time to see how all of this works together. Go to the Opportunity record that you want to mark Closed Won. Change its status to Closed Won. Now you can go to TaskRay to see if the new Customer Onboarding project has been created.