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

how do i query userlicense name from user object?
Hi all, how do i query userlicense name from user object?i need to list out the users name based on the user license (ex:Userlicense ='Salesforce') .pls provide with suitable example asap Thanks
I don't think you can do it in a single query, or well .. I can't at least.
You can get to it by code though, wrote some code to collect and spit users by userlicense, didn't test it , or put code to out put a result, but I hope you get the Idea. Probably can be done better optimized too.
.
List<AggregateResult> arlist = [Select Username uname, UserType utype From User Group By UserType, Username ];
for(AggregateResult ar : arlist) {
System.debug(' --------------- UserType: ' + ar.get('utype') + ' Username: ' + ar.get('uname') );
}
from User
Do you know how to make it return the license name, I'm trying to get it to return 'Salesforce' or 'Salesforce Platform'
If yes, you should switch to Workbench (https://workbench.developerforce.com/), Maven Tools for Salesforce (https://chrome.google.com/webstore/detail/maven-tools-for-salesforc/kgookdjjmmekebgdecakmblghjgiaoem?hl=en) or any other tool that you can use to run SOQL queries