You need to sign in to do that
Don't have an account?

Updateing Accounttammeber object via Trigger issue
Could somebody please let me know why I can update AccountAccessLevel field on the AccountTeamMember object?
public class Acceleration_CollaborativeTeam {
public static void updateAccountTeam(id accountid, id userid , string role, string action)
{
Boolean existingrecord = false;
List<AccountTeamMember> atmlist = new List<AccountTeamMember>();
for (AccountTeamMember atm : [select UserId, TeamMemberRole,Id,CreatedById,AccountId, AccountAccessLevel from AccountTeamMember where (AccountId = :accountid and UserId =: userid and TeamMemberRole =: role)]) {
existingrecord = true;
}
if (existingrecord = true)
{
AccountTeamMember newatm = new AccountTeamMember();
newatm.AccountId = accountid;
newatm.UserId= userid;
newatm.TeamMemberRole = role;
// newatm.AccountAccesslevel = 'Read';
atmlist.add(newatm);
}
if (atmlist.size() > 0) {
insert atmlist;
}
}
}