You need to sign in to do that
Don't have an account?
Aishwarya Rao 6
Account Trigger Issue: Loop variable must be of type Account
Hi Friends,
Am trying to create a Trigger on Account object but am getting the Error as : Loop variable must be of type Account at line 4 column 14
Can anyone give me a solution to the following code
trigger accTrigger on Account(After Insert) {
set<string> names = new set<string>();
for(account acc : trigger.new) {
}
}
Am trying to create a Trigger on Account object but am getting the Error as : Loop variable must be of type Account at line 4 column 14
Can anyone give me a solution to the following code
trigger accTrigger on Account(After Insert) {
set<string> names = new set<string>();
for(account acc : trigger.new) {
}
}
There may be a chance to have a class Name as "Account", Rename that specfic class name, then try save your trigger.
All Answers
I am trying your shared code its not giving me error.Can you please share the whole code where you getting the error.
Just go devloper console write same code there
trigger accTrigger on Account (before insert) {
set<string> names = new set<string>();
for(account acc : trigger.new) {
}
}
for(Account acc:trigger.new) is it giving error
There may be a chance to have a class Name as "Account", Rename that specfic class name, then try save your trigger.