Template Versioning introduces new template Ids, called Addressable Ids, that maintain the mapping between your automations and templates. When an Addressable Id is used in an automation, it will always point to the active template version. This article walks through how to update template references in a stitching Flow from Salesforce Ids to Addressable Ids.
Below are the high-level steps:
- Relate Task Groups to Products Using Addressable Ids
- Update the Task Group Formula Field on Opportunity Products
- Update Template References in Your Flow
- Save & Activate Your Flow
Step 1: Relate Task Groups to Products Using Addressable Ids
To use stitching, you previously related Template Task Groups to Products using a lookup relationship. To gain the full benefits of Template Versioning, this relationship needs to be changed to use Addressable Ids. We have added a new field on Product for the Template Task Group Addressable Id. Use the process below to populate this field for every Product.
- Open a Product
- Locate the Task Group lookup (e.g. Template Task Group), and click on the name to open it.
- Record the Salesforce Id of the Task Group, which will be part of the URL in the address bar. Highlight and copy the Id, which is usually listed after "TASKRAY__trTaskGroup__c/"
Note: The URL will appear differently for Salesforce Classic and Salesforce Lightning. Additionally, the last 3 characters are not part of the Id. Do not copy them for this purpose.
- Keep your Product record open and in a new tab, open Reports.
- Under Folders, select All Folders | TaskRay Template Reports.
- Open the Template Versioning Setup Report 1 report.
- Using the Template Project Salesforce Id you recorded above, find and record the corresponding Addressable Id (e.g. "PT_RVSNBY1C5.TG_IWD2rxgM5").
Tip! Use Search to quickly find the Salesforce Task Group Id in the report.
- Return to your Product record and populate the Template Task Group Addressable Id field with the Addressable Id you recorded in the step above.
- Repeat for every Product that has a Template Task Group.
Step 2: Update the Task Group Formula Field on Opportunity Products
- From Setup, navigate to:
- Lightning: Objects and Fields | Object Manager. Select the Opportunity Product object.
- Classic: Build | Customize | Opportunity Products | Fields.
- Under Custom Fields and Relationships, find your Template Task Group formula field and open it.
- Click Edit.
- Delete the existing formula.
- Configure the formula to point to the "Template Task Group Addressable ID" field we populated on the Product object. Do this by clicking on the Insert Field button and then following Opportunity Product > Price Book Entry > Product > Template Task Group Addressable Id. It should insert "PricebookEntry.Product2.TASKRAY__trTemplateTaskGroupAddressableId__c" into your formula.
- Click Save.
Step 3: Update Your Flow
- From Setup, navigate to:
- Lightning: Process Automation | Flows
- Classic: Create | Workflows & Approvals | Flows
- Open your stitching Flow (e.g. "Stitch Project").
- In the left sidebar, select the Manager tab.
- Under Variables, click templateProjectId.
- Copy the Default Value (e.g. "a024w00000eVGuY")
- In a new tab, open Reports.
- Under Folders, select All Folders | TaskRay Template Reports.
- Open the Template Versioning Setup 1 report.
- Using the Default Value you recorded above in Step 5, find and record the corresponding Addressable Id (e.g. "PT_RVSNBY1C5.PJ_sBZKF30r8").
Tip! Use Search to quickly find the Salesforce Task Group Id in the report.Note: If your template has multiple Task Groups, a count of the Task Groups will appear at the end of the Id in parenthesis e.g. "(3)" Do not record this; it is not a part of the Addressable Id.
- Go back to your Flow, and open the TemplateProjectId variable if it is not already open. Replace the Default Value with the Addressable Id from the step above.
- Click Done.
- On the canvas, open the TaskRay apex action, Stitch a Project.
- Find the New Project Template Salesforce Id input and switch it to Don't Include.
- Switch the input above, New Project Template Addressable Id, to Include. For the input select Variables | templateProjectId.
- Similarly, find the Task Group Salesforce Id List input and switch it to Don't Include.
- Switch the input above, Task Group Addressable Id List, to Include. For the input select Variables | templateTaskGroupIdList.
- Click Done.
Step 4: Save & Activate Your Flow
That's it! Save your changes and activate your Flow. Once activated, return to Setup Template Versioning utility in Tools and Settings to complete the setup process.