+ Start a Discussion
yaswanth kumaryaswanth kumar 

how can we update the roles of a two different profiles in salesforce

Shashikant SharmaShashikant Sharma
Can you explain more what is the problem that you want to solve ?
varaprasad vvaraprasad v
Hi Yaswanth ..
may be this will provide some idea i think..
sample example
list<user> u = [Select userrole.name,profile.name from user];
for(user ur : u){
user usr = new user();
if(usr.profile.name == x){
  usr.userrole.name = 'y';
then add to list
}update list.