Routing - Any Object Routing Setup Guide Follow
Contents:
Overview
Any Object Routing gives you the ability to use the FlowBuilder interface to create and manage routing logic for any standard or custom Salesforce objects.. This will ensure that the objects that are relevant to your organization's specific processes get assigned to the appropriate owner automatically & actioned accordingly.
The following guide will walk you through the steps to get Any Object Routing enabled in your Salesforce instance.For a more comprehensive overview of the Routing features that are available in Any Object Routing, please refer to the Any Object Routing Overview.
Prerequisites
Object Eligibility
You can configure up to 5 objects for Any Object Routing. These objects must fall under one of the following categories:
- Any triggerable custom object in Salesforce
- Any triggerable, sObject type, standard object in Salesforce from API Version 47.0 or prior.
Note: Standard objects released on API Versions 48.0 onwards are not currently supported.
Permissions
Please ensure the LeanData Integration User has the proper permissions for each object you wish to configure with Any Object Routing
- Setup > Profiles > Your profile (ex: System Administrator)
- Object Settings
- Select “Object Settings”
- Create/Read/Edit for appropriate object permissions (should have All Access)
Whoever is setting up Any Object Routing will need Author APEX permissions
Steps to Set Up
Please Note: Salesforce Enterprise and Unlimited Orgs cannot have APEX Triggers or Classes set-up directly in your Production instance. These must first be set up in a Sandbox and then migrated to Production. In addition to the trigger, this requires a Test Coverage class and an Outbound Change Set.
1. Contact LeanData to Enable Backend Setting
Once you have confirmed your objects are eligible for Any Object Routing, please contact LeanData Support to enable the proper backend setting for these objects.
2. Navigate to the Salesforce Developer Console.
Click on the Gear Icon in your Salesforce instance. For Salesforce Classic, you can click on your name. The click on Developer Console. If you do not see Developer Console, please check your Salesforce permissions.
3. Modify an Existing APEX Trigger (Or Create a New Trigger)
Note: Salesforce's best practice is to consolidate any trigger operations to a single Trigger per object. As such, we recommend modifying an existing trigger rather than creating a new trigger on your desired object.
Modify an Existing APEX Trigger
Follow these steps to update an existing trigger in your SFDC org on the desired object for Routing. You may skip down to Creating a New APEX Trigger if you wish to create a new trigger instead.
- Navigate to File > Open > Triggers > [Existing Trigger Name]
- Copy and paste the below code into the existing trigger:
trigger <EXISTING FILE NAME> on <CUSTOM OBJECT> (after insert, after update) { LeanData.LeanDataAPI.triggerRouting(); } |
- Replace <EXISTING FILE NAME> with your [Existing Trigger Name] from the previous step
- Replace <CUSTOM OBJECT> with the appropriate sObject type for the desired object
Creating a new APEX Trigger (you may skip to step 4 if you chose to modify an existing trigger instead)
- Follow these steps to create a net new trigger on the desired object for routing.
- Navigate to File > New > Apex Trigger
- Specify a Trigger Name
- Specify the desired sObject for Routing
- Copy & Paste the below code:
trigger <NEW FILE NAME> on <CUSTOM OBJECT> (after insert, after update) { LeanData.LeanDataAPI.triggerRouting(); } |
- Replace <NEW FILE NAME> (without brackets) your Trigger Name from the previous step
- Replace <CUSTOM OBJECT> (without brackets) with the appropriate sObject type’s API Name from the previous step
4. Create Test Coverage Class within Sandbox
Note: Steps 4 - 6 are only necessary when deploying triggers within a Sandbox as is required in Salesforce Enterprise and Unlimited Editions.
- Create a record of the object to test your triggers. Test for:
- Validation Rules
- Required fields
- Additional requirements associated with object’s record creation
5. Create Outbound Change Set
Note: For steps 5-6, please see Change Set Setup and Configuration for more information.
- Navigate to Salesforce Setup > Create an Outbound Change Set
- Click New to create a new change set and specify a name.
- Click add to add components and select your APEX Trigger(s)
- Select your test Coverage Class
- Click Upload to select the target organization and upload the change set
6. Validate and Deploy Inbound Change Set
- In the destination instance (Production instance or the next Sandbox in your progression), navigate to Salesforce Setup > Inbound Change Sets
- Validate & Deploy the change set from Step 6 per your required IT process.
- Specify test coverage to run from Step 4
- Configure any additional options necessary.
- Note: Ensure your validation rules do not differ between instances.
For any additional information please contact LeanData Support.