-
-
Save TheShubhamVsnv/24e86d74dd84c29c11bec05b5ae54316 to your computer and use it in GitHub Desktop.
Problem: You need to create an apex trigger on the contact object which trigger whenever a new contact is created or updated and update the description accordingly
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 TgrContactBeforeInsertUpdate on Contact (before Insert, before Update) { | |
for( contact c : Trigger.new ) | |
{ | |
if(trigger.isInsert) | |
{ | |
c.description = 'contact created successfully by insert trigger '; | |
} | |
else if(trigger.isUpdate) | |
{ | |
c.description = 'contact update successfully by else update block'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment