Skip to content

Instantly share code, notes, and snippets.

@AlwaysThinkin
Last active June 29, 2019 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AlwaysThinkin/8e9ce4621eea9821d9e4820fb6078826 to your computer and use it in GitHub Desktop.
Save AlwaysThinkin/8e9ce4621eea9821d9e4820fb6078826 to your computer and use it in GitHub Desktop.
trigger CompetitorContactTrigger on Contact (before insert, before update) {
//Get a list of all our Competitors' names from our Custom Metadata
//Create an empty List of Strings to hold your Competitors' names
for(){//Query your Custom Metadata and get its Label field
//Add the Label to your List of Strings
}
//Create a Map of IDs to Accounts; populate your map on the same line by putting a query in the parentheses.
//Your query will just get Account IDs from Account where the Name is in your List of Strings
//Loop through your Contacts in Trigger.new
//Check if your Map contains the AccountId from each Contact
//If it does, set DoNotCall = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment