Last active
August 29, 2015 14:08
-
-
Save joshbirk/1459ce3a17c7f16cdc70 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 RestrictContactByName on Contact (before insert, before update) { | |
//check contacts prior to insert or update for invalid data | |
For (Contact c : Trigger.New) { | |
if(c.LastName == 'INVALIDNAME') { //invalidname is invalid | |
c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment