• Sateesh m
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
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');
        }
    }
}
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');
        }
    }
}