function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hiral Patel 25Hiral Patel 25 

AccountTeamMember actteam = New AccountTeamMemeber();

Invalid type: AccountTeamMemeber
Variable does not exist: TeamMemeberRole
why i am showing error?

trigger AccountTeamMemberAssign on Account (after insert) 
{
   user u = [Select id from user where alias = 'rpate'];
    for (Account acc : Trigger.New)
   {
       if (acc.Annualrevenue > 500000)
       {
          AccountTeamMember actteam  = New AccountTeamMemeber();
          actteam.UserId = u.Id;
          actteam.AccountId = acc.Id;
          actteam.TeamMemeberRole = 'Account Manager';
           
           
       }
   }
}
SwethaSwetha (Salesforce Developers) 
HI Hiral,
Can you correct the spelling of AccountTeamMember in this line of your code and see if it works
AccountTeamMember actteam  = New AccountTeamMemeber();

Also, refer to the code snippet mentioned in https://salesforce.stackexchange.com/questions/206202/inserting-accountteammember-on-account on the best practices to be followed

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you