Salesforce:APEX Triggers

From Melissa Data Wiki
Jump to navigation Jump to search

← Clean Suite for CRM:Salesforce

Apex Triggers

Some users may have the need for their Salesforce records to be validated & standardized as soon as they're entered or saved into Salesforce. In that case, an Apex Trigger would be appropriate for that. Setting up an apex trigger for Clean Suite involves going into Salesforce Setup and creating a new trigger on the object you would like the trigger to run on. Below is an example of an apex trigger for invoking the Global Address component on the Contact object after a record has been inserted or updated:

trigger globalAddress on Contact (after insert, after update) {
    for (Contact contact : {
        if (!Test.isRunningTest()) {
            if(!System.isFuture() && !System.isBatch()) {

The highlighted portion in the code snippet below can be changed to use the other components:


  • MD_GlobalEmailWSExt.doOneGlobalEmail
  • MD_GlobalPhoneWSExt.doOneGlobalPhone
  • MD_PersonatorWSExt.doOnePersonator
  • MD_PropertyV4WSExt.doOneLookupProperty