-
-
Save TheShubhamVsnv/e97a3c863f5597a0f92deb5996bd62a8 to your computer and use it in GitHub Desktop.
When an Opportunity is greater than $20k, mark is_gold to TRUE
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 TriggerExample4 on Account (After Update) { | |
integer amount=20000; | |
For(Account acc:trigger.new){ | |
List<opportunity> opps=[select id from opportunity where Account.id=:acc.id And Amount > 20000]; | |
If(opps.size()>0){ | |
acc.Is_Gold__c=True; | |
}Else{ | |
acc.Is_Gold__c=False; | |
} | |
update acc; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment