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

Comparison arguments must be compatible types: List<AccountTeamMember>, Schema.SObjectField
Hello Everyone,
I am stuck on this error and I am not sure what I am doing wrong.
Not sure How I can compare AccountTeamRoles UserIds to Contact's UserIds without getting an error?
Any guidance will be of great help.
Thank you,
I am stuck on this error and I am not sure what I am doing wrong.
trigger testTriggeronContact on Contact (before insert) { List<Contact> contactCheck = new List<Contact>(); List<Account> AccountCheck = new List<Account>(); If(trigger.isBefore && trigger.isinsert){ For(Contact c : trigger.new){ //Get contactId from Trigger string contactId = c.Id; //Gets Current AccountId Related to Contact Contact AccId = [SELECT AccountId FROM Contact WHERE Id = :contactId limit 1]; //Gets Account Team Members from Account Related to Contact List<AccountTeamMember> atmID =[Select UserId From AccountTeamMember WHERE AccountId = :accId.AccountId ]; for (User x : atmID){ If (x == User.Id){ some code here... } else{ some code here.... } } } } }I am getting this error at line If( x==User.Id).
Not sure How I can compare AccountTeamRoles UserIds to Contact's UserIds without getting an error?
Any guidance will be of great help.
Thank you,
Try this .. you loop must be with AccountTeamMember and not with user