You need to sign in to do that
Don't have an account?
sfdcChi2
trigger SSSUpdate on User (before Update)
{
For (User u1 : Trigger.New)
{
UserTeamMember u = [SELECT UserId, User.Name FROM UserTeamMember where TeamMemberRole= 'Sales Support Specialist'
AND OwnerId=:u1.ID];
u1.SSS__c= u.UserId;
}
}
need help bulkifying this trigger
trigger SSSUpdate on User (before Update)
{
For (User u1 : Trigger.New)
{
UserTeamMember u = [SELECT UserId, User.Name FROM UserTeamMember where TeamMemberRole= 'Sales Support Specialist'
AND OwnerId=:u1.ID];
u1.SSS__c= u.UserId;
}
}
users.get(u.id).id; is wrong
it should be
users.get(u.id).userid;
or you need to update line 5 select command to include ID.
Cheers
Dan
and leave it as users.userid
this may be something odd with the userteammember object that i've not come across before as the code i've given you is near identical to what I use on my accounts and opportunities..