CustomFit Dashboard
  • Getting Started
    • Installing CustomFit Code Snippet
      • Installing the code snippet on Webflow
      • Installing the code snippet on Wordpress
      • Installing the code snippet on Wix
      • Installing the code snippet on Shopify
      • Installing the code snippet on Unbounce
  • Account Setup
    • Configuring Account Users
    • Add Users and Assign Roles
    • Configuring Subdomains
    • Configuring Traffic Blocking
  • Experience
    • How to create an A/B test
    • How to create a Split URL test
    • How to create a Shopify theme based testing
    • How to create an AI Conversion Optimize experience
    • How to create an Outbound Experience
    • Creating an Experience
    • Experience Page Paths
    • Experience Targeting
    • Visual editor
    • Experience Goals
    • Experience Insights
    • Experience Settings
    • Experience Dashboard
    • Experience FAQs
  • Visual Editor
    • Overview
    • App Bar
    • Editor Palette
    • Toolbar
    • Popups
  • ABM
  • Audience Segments
    • Geo Location
    • Technology
    • UTM Parameters
    • Visitor Attributes
    • Salesforce Attributes
    • HubSpot Attributes
    • Kickfire Attributes
    • Visitor Behavior
      • Page event
      • Click event
      • Track event
  • Integrations
    • GA4 Integration
    • GA4 Integration via GTM
    • Microsoft Clarity Integration
    • Hotjar Integration
    • Clearbit Integration
    • 6sense Integration
    • Segment Integration
    • Mixpanel Integration
    • Amplitude Integration
    • Heap Integration
    • Salesforce
      • Connected App
      • Apex Class
      • Apex Triggers
      • Remote Site Settings
    • Kickfire
    • HubSpot
    • Slack
  • Split URL Testing
  • Reports
    • Create Report
    • Configure Targets
    • Configure Goals
  • Overview of Reports
  • Segments
    • Creating a Segment
    • Segment Rules
  • Dashboard
    • Analytics
  • Install the CustomFit snippet
  • Event Analyzer
    • Creating an Event
    • Forward Custom Events from GTM to CustomFit
    • Event Insights
    • Event Properties
    • Property Insights
  • Change Log
  • Frequently Asked Questions
    • CustomFit JS Script
Powered by GitBook
On this page

Was this helpful?

  1. Integrations
  2. Salesforce

Apex Triggers

PreviousApex ClassNextRemote Site Settings

Last updated 4 years ago

Was this helpful?

Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions. You can know more about Apex triggers . You need to create three different triggers

  1. Contact Trigger - If there is any change to the Contact then contact trigger will be invoked

  2. Lead Trigger - If there is any change to the Lead then lead trigger will be invoked

  3. Account Trigger - If there is any change to the Account then account trigger will be invoked

To create a trigger follow the below steps

  • Click on settings icon

  • Then click on Setup option from the dropdown

  • Search for Apex Triggers option and click on it

  • Click on Developer Console button

  • In the developer Console click on File

  • Click on New and Select the Apex Trigger option

  • For the Contact Trigger give the

    • Name as ContactTrigger

    • For sObject select Contact from the dropdown

  • Then paste the below code

trigger ContactTrigger on Contact (after insert,after update,after delete) {
    CustomFitWebHook.callout(CustomFitWebHook.jsonContent(Trigger.new, Trigger.old));
}
  • Atlast save the code

  • For the Lead Trigger give the

    • Name as LeadTrigger

    • For sObject select Lead from the dropdown

  • Then paste the below code

trigger LeadTrigger on Lead (after insert,after update,after delete) {
    CustomFitWebHook.callout(CustomFitWebHook.jsonContent(Trigger.new, Trigger.old));
}
  • Atlast save the code

  • For the Account Trigger give the

    • Name as AccountTrigger

    • For sObject select Account from the dropdown

  • Then paste the below code

trigger AccountTrigger on Account (after insert,after update,after delete) {
    CustomFitWebHook.callout(CustomFitWebHook.jsonContent(Trigger.new, Trigger.old));
}
  • Atlast save the code

here