Last active
June 29, 2019 14:27
-
-
Save AlwaysThinkin/8e9ce4621eea9821d9e4820fb6078826 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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