You need to sign in to do that
Don't have an account?
Shruthi MN 71
Apex Trigger 'Expression cannot be a statement.'
Please correct the below code
trigger AccountTrigger on Account (after update ,after insert) {
for(Account a: Trigger.new){
if(a.industry== 'Energy'){
a.Rating =='Hot';
}
}
}
I am getting below error
trigger AccountTrigger on Account (after update ,after insert) {
for(Account a: Trigger.new){
if(a.industry== 'Energy'){
a.Rating =='Hot';
}
}
}
I am getting below error
Change the above line a.Rating =='Hot'; to a.Rating ='Hot'; and it should work.
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.