You need to sign in to do that
Don't have an account?
Jason wang 29
I want to find specific license user!
I want to create a new user which license is salesforce. But the license was all used. Also can`t see the salesforce license user in Setup>Users page.How to find it?
You can use below SOQL query to find the users having Salesforce license. Thanks,
Govindaraj.S
All Answers
You can use below SOQL query to find the users having Salesforce license. Thanks,
Govindaraj.S
Following code helpful for you:
Map<Id,Profile> profileIds = new Map<id,profile>([SELECT Id,UserLicenseId FROM Profile where UserLicenseId in (SELECT Id FROM UserLicense where name ='Salesforce')]);
List<user> standardProfileUsers = [select id from user where profileId in:profileIds.Keyset()];
system.debug('standardProfileUsers->'+standardProfileUsers);
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi