You need to sign in to do that
Don't have an account?
sainath reddy 54
Hi guys, someone help me here with this scenario: When a new Case is created with case origin as Web then add the user karthic as CaseTeamMember
Unable to create a new case member here:
public class opportunityteammembertask {
public static void teamopptyt(list<opportunity> oppty){
user u =[select id from user where alias =: 'sai'];
list<opportunityteammember> opptyteam = new list<opportunityteammember>();
for(opportunity op:oppty)
{
if(op.Amount >= 5000000){
opportunityteammember tm = new opportunityteammember();
tm.OpportunityId =op.id;
tm.UserId=u.id;
tm.TeamMemberRole='Channel Manager';
//tm.OpportunityAccessLevel='Read/Write';
opptyteam.add(tm);
}
} if(opptyteam.size() > 0){
insert opptyteam;
}
}
}
public class opportunityteammembertask {
public static void teamopptyt(list<opportunity> oppty){
user u =[select id from user where alias =: 'sai'];
list<opportunityteammember> opptyteam = new list<opportunityteammember>();
for(opportunity op:oppty)
{
if(op.Amount >= 5000000){
opportunityteammember tm = new opportunityteammember();
tm.OpportunityId =op.id;
tm.UserId=u.id;
tm.TeamMemberRole='Channel Manager';
//tm.OpportunityAccessLevel='Read/Write';
opptyteam.add(tm);
}
} if(opptyteam.size() > 0){
insert opptyteam;
}
}
}
Can you please try writing trigger on case with the check of web origin and
and add the team member
Refer below sample code written on Account :-
Regards,
Ranjan