Salesforce Integration User Guide
Details about the Invocable Methods and Apex Triggers available in the SaaSquatch for Salesforce Integration.
Getting Started: Installation
Installation instructions for the SaaSquatch for Salesforce Integration can be found in our Salesforce Installation Guide. It is recommended to follow that guide to complete the initial installation before adding any of the customizations outlined in this guide.
🔗 Process Builder vs. Workflow Rules vs. Apex Triggers
Salesforce provides a number of tools for automating your business processes, including Lightning Process Builder, Workflow Rules, and Triggers.
The Salesforce Process Builder tool provides teams the ability to build and configure simple worksflows using drag-and-drop and point-and-click tools without the need to write any code.
Workflow Rules can help automate processes like Tasks, Email Alerts, Field Updates, and Outbound Messages. Each Workflow Rule consists of a Criteria and either an Immediate action or a Time-dependent action.
Apex Triggers are built using Apex code and are an advanced functionality available in Salesforce which provides the ability to build out custom functionality and workflows.
In most cases it is recommended to build something in Process Builder unless the desired functionality cannot be acomplished there. Business processes configured in Process Builder are much more stable in the long term compared to Workflow Rules and Apex Triggers as they don't require continual updates to remain functional.
Further details about which tool to use when automating your business processes through Salesforce can be found in the Salesforce Trailhead.
🔗 Example Conversion Trigger via SFDC Process
🔗 A. Add Custom Field to your Contact or Lead Object
🔗 1. Create a New Custom Field
From the Lightning "Fields & Relationships" menu in the Contact or Lead Object Manager page, select the option to create a New Custom Field.
After selecting the Field Type that suits your needs, make sure to fill out the Field Label, the Field Name, and a description of the process and complete the rest of the Custom Field Creation.
🔗 2. Include Custom Field in Contact/Lead Layout
Head to the Lightning "Page Layout" menu in the Object (Contact/Lead) you just added that new Custom Field to, and ensure that that field is added to a Page Layout that is in use so you can make use of that field.
Details about adding a Custom Field to your Salesforce Object can be found in the Salesforce Trailhead.
🔗 B. Add SaaSquatch Process Builder Action
🔗 1. Create a New Process
From the Lightning Process Builder page select the option to create a New Process. Make sure fill out the Process name, a description of the process, and when the process starts.
It is also possible to add one of the SaaSquatch Invocable Methods to an existing Process. This can be done by adding an action in Step 4 of this guide.
🔗 2. Choose an Object
+ Add Object to select the subject of the Process start criteria. When this chosen object is either created or updated that will start the process.
🔗 3. Add Critera
The Critera being checked in order for your Process to continue running will depend on what you are looking to accomplish with your Process. For example, this Critera could be something like looking for a specific field in the contact record having been updated.
🔗 4. Add Action
The SaaSquatch Invocable Methods can be added as actions in Process Builder. Make sure you have created a Custom Object Field and displayed in the Page Layout of your Salesforce Object of choice (Lead or Contact) before proceeding with the next step.
- A. Click
+ Add Actionand select an
ApexAction Type. Growth Automation programs will require an addition or change to a "Lead" or "Contact" Object.
- B. Select and Define the Action:
- Select a name for your
Action, something like "Convert Referral" or how frequently the action should run, like "Always".
- Select the
Apexclass you would like to use. In this example the "Upsert User by Contact" class was used. Details about each of the available Invocable Methods in the SaaSquatch for Salesforce Integration can be found below.
- Set the
ApexVariables: The SaaSquatch Invocable Method
Upsert User by Leadwill sync a
customFieldto the SaaSquatch record when the associated custom Field in SFDC is created or changed.
In this example the
field1Keyis equal to the SaasSquatch
customFieldvalue and the
field1Value is equal to the property of thecustomField`'s attached value pairing:
- Select a name for your
Details about adding an actions or criteria to your Salesforce Process can be found in the Salesforce Trailhead.
🔗 Invocable Method List
The Referral SaaSquatch for Salesforce integration provides the following Invocable Methods for use in your Salesforce instance.
Please Note: Invocable Methods tagged with Classic are only applicable to programs running on our Classic referral programs, not those on our Growth Automation platform. Please contact SaaSquatch to find out which method is right for your program.
|Method Name||Version Introduced||Input Variable Name||Expect Variable Type||Expected Value||Description|
|Track Event by Id||v1.4.0||
||String||Id||Track a list of events for SaaSquatch Users based on their SaaSquatch User and Account Ids|
|Track Event by Lead||v1.4.0||
||Lead||Lead||Track a list of events for SaaSquatch Users based on their associated SFDC Lead record|
|Track Event by by Contact||v1.4.0||
||Contact||Contact||Track a list of events for SaaSquatch Users based on their associated SFDC Contact record|
|Upsert User by Id||v1.3.0||
||String||Id||Update a list of SaaSquatch Users based on their SaaSquatch User and Account Ids. As of v1.4.0 supports Immediate Object Upsertion.|
|Upsert User by Lead||v1.3.0||
||Lead||Lead||Update a list of SaaSquatch Users based on their associated SFDC Lead record. As of v1.4.0 supports Immediate Object Upsertion.|
|Upsert User by Contact||v1.3.0||
||Contact||Contact||Update a list of SaaSquatch Users based on their associated SFDC Contact record. As of v1.4.0 supports Immediate Object Upsertion.|
|Classic Upsert User by Opportunity||v1.3.0||
||Opportunity||Opportunity||Update a list of SaaSquatch Users based on their associated SFDC Opportunity record. As of v1.4.0 supports Immediate Object Upsertion.|
|Classic Convert Referral by Id||v1.2.0||
||String||Id||Converts a list of SaaSquatch Accounts based on their SaaSquatch Account Ids|
|Classic Convert Referral by Contact||v1.2.0||
||Contact||Contact||Converts a list of Salesforce Contacts|
|Classic Convert Referral by Opportunity||v1.0.0||
||Opportunity||Opportunity||Converts a list of Salesforce Opportunities|
🔗 Custom Triggers
Advanced users can also use an Apex Trigger to call SaaSquatch invocable methods. If you're looking for a more fine-grained alternative to Process Builder check out Using a Salesforce APEX Trigger to upsert a Lead
🔗 Default SaaSquatch Triggers
The SaaSquatch for Salesforce Integration includes a number of built in triggers. The majority of these triggers are enabled by default to provide the standard functionality of the integration, such as linking Users to Contacts & Leads and cascading custom fields.
A full list of the available SaaSquatch Triggers can be found in your Salesforce instance under Setup -> Custom Metadata Types -> "Manage Records" for "Referral SaaSquatch Trigger". You can disable these triggers individually to help diagnose compatibility issues with any other triggers and processes in your Salesforce organization.