function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Adila Hilal 15Adila Hilal 15 

how I can get all roles assigned to in active users in salesforce?

SUCHARITA MONDALSUCHARITA MONDAL

Hey Adila,/
You can use SOQL for the same

SELECT  Id, Name, IsActive, Profile.Name, UserRole.Name FROM User WHERE IsActive = true

Hope this helps!

Thanks
Sucharita

AbhinavAbhinav (Salesforce Developers) 
Hi Adila,

User can only be assigned one role .

Multiple role for a user is still an Idea.

https://trailblazer.salesforce.com/ideaView?id=08730000000BqZR#:~:text=Users%20can%20only%20be%20assigned%20to%20one%20role.

Thanks!
Suraj Tripathi 47Suraj Tripathi 47

Hi,

Go to dev console of query editor

SELECT  Id, Name, IsActive, Profile.Name, UserRole.Name FROM User WHERE IsActive = true

Please mark it as the Best Answer if your queries are solved.

Thank You