You need to sign in to do that
Don't have an account?
How to get all users of salesforce using apex code
Hello,
I have tried below code as you shared but there are something error so please let me know what can i do to fix this issue.
@RestResource(urlMapping='/User/*')
global with sharing class UserListClass{
@HttpGet
global static List<User> getUserList() {
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()];
return standardProfileUsers;
}
}
Blow image is appear on error screen shot so please see this issue and what can i do to fix this issue..
Please let me know, if we can do meeting for discussion related to saleforce apex code issue...
I don't see any issues with your code but I suggest reviewing the solution listed here
Let me know if it helps. If it does, please mark this answer as Best. It may help others in the community. Thank You!