I need a report that shows all roles. Currently I have created a report on user which shows those roles which have users assigned, but I need to show all roles with or without users assigned.
I need a report that shows all roles. Currently I have created a report on user which shows those roles which have users assigned, but I need to show all roles with or without users assigned.
Best Answer
You can't run a report against the UserRole object but you can try this instead:
Go into the Developer Console and select the SOQL query tab or you can login to workbench.developerforce.com.
Go to the Queries Menu/SOQL Query
Paste this query in the query box and click the Execute (or Query) button.
This query selects all roles that are not found in the User table.
This is what you get:
You can then run the same query a bit modified to get all Roles that are assigned
The results can be placed in excel and then imported to a custom object where you can create a report on it if you wanted.