Hi vishal, Try below code.I have tried this in my org.Please modify code according to your requirement.
public class userRoles {
list<user> ulist = new list<user>();
public void getuserRolebyId(){
List<AggregateResult> ulist = [SELECT UserRoleId , count(Id)idsCount FROM User group by UserRoleId];
for(AggregateResult a : ulist){
if(a.get('UserRoleId')!= null)
system.debug(a.get('UserRoleId') +':'+ a.get('idscount'));
}
}
}
Hope this helps you If this helps kindly mark it as solved so that it may help others in future.
Hi vishal, Try below code.I have tried this in my org.Please modify code according to your requirement.
public class userRoles {
list<user> ulist = new list<user>();
public void getuserRolebyId(){
List<AggregateResult> ulist = [SELECT UserRoleId , count(Id)idsCount FROM User group by UserRoleId];
for(AggregateResult a : ulist){
if(a.get('UserRoleId')!= null)
system.debug(a.get('UserRoleId') +':'+ a.get('idscount'));
}
}
}
Hope this helps you If this helps kindly mark it as solved so that it may help others in future.
Try below code.I have tried this in my org.Please modify code according to your requirement.
Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.
Thanks and Regards
All Answers
Try below code.I have tried this in my org.Please modify code according to your requirement.
Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.
Thanks and Regards
Thanks and Regards