Query for Users with License
Query for Users with Salesforce License
- 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 Name from user where profileId in:profileIds.Keyset()];
- System.Debug(standardProfileUsers);
Comments
Post a Comment