You need to sign in to do that
Don't have an account?
Sateesh m
Initial term of field expression must be a concrete SObject: LIST<Account>
Please find the below trigger ...getting below error " Initial term of field expression must be a concrete SObject: LIST<Account>"
Could you please let me know what is this error ?
trigger AccountDuplicate on Account (before insert, before update)
{
for(Account a:Trigger.new)
{
List<Account> acc =[select id, Name from Account where Name=:a.Name];
if(acc.size()>0)
{
acc.Name.addError('You Cannot Create the Duplicate Account');
}
}
}
Could you please let me know what is this error ?
trigger AccountDuplicate on Account (before insert, before update)
{
for(Account a:Trigger.new)
{
List<Account> acc =[select id, Name from Account where Name=:a.Name];
if(acc.size()>0)
{
acc.Name.addError('You Cannot Create the Duplicate Account');
}
}
}
acc.Name.addError('You Cannot Create the Duplicate Account');
All Answers
acc.Name.addError('You Cannot Create the Duplicate Account');
a.Name.addError('You Cannot Create the Duplicate Account');