You need to sign in to do that
Don't have an account?
Hiral 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';
}
}
}
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';
}
}
}
Can you correct the spelling of AccountTeamMember in this line of your code and see if it works
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