You need to sign in to do that
Don't have an account?
How to get all users of salesforce
Hello,
I have tried below solution as you shared but getting some problem so please let me know how can fix this problem and get all users of salesforce using apex.
@RestResource(urlMapping='/User/*')
global class UserListClass{
@HttpGet global static List getUser() {
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;
}
}
One more think, Could we set a meeting for some discussion related to apex code and some other things.
If it's possible to meeting setup, please let me know.
Can you try the below snippet once:
Also, can you please check if the soql that is used if it is proper and if it is returning the proper list of records that needs to be returned.
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.