SELECT Name, Owner.Name, Owner.UserRole.Name, Owner.Profile.Name FROM Account
Output:
Cheers!!!
7 thoughts on “Query to fetch Role name and Profile Name of record Owner”
hi mulgan if i write the above mentioned query it shows an error, it was not executing the Error is "Parent relationship queries are disabled in Workbench: Owner.Name". So please send correct query.
Go to the workbench setting and in the Query & Search option click on the check box "Allows SOQL Parent Relationship Queries" and click on apply setting.
You will be able to access the parent relationship queries.
This was very helpful. I needed to use Data loader to extract Accounts for 4 User roles. This info helped me create:
Select Id,Name,OwnerId FROM Account WHERE Owner.UserRole.Id IN('00E90000001ZHwfEAG','00E90000001ZHwkEAG','00E90000000Qfy2EAC','00E90000000Qfy7EAC')
Can you get this to show the profile name of the owner of an opportunity? I was not able to find the owner.profile.name when searching for field options in workbench
Try this query: SELECT Name, Owner.Name, Owner.UserRole.Name, Owner.Profile.Name FROM Opportunity in workbench. Don't look for fields as they are related fields.
hi mulgan if i write the above mentioned query it shows an error, it was not executing the Error is "Parent relationship queries are disabled in Workbench: Owner.Name". So please send correct query.
Workbench doesn't support this. Use force.com explorer.
Cheers!
Then why are you tested it by work bench(if you don't mind), is there any specific reason……?
Go to the workbench setting and in the Query & Search option click on the check box "Allows SOQL Parent Relationship Queries" and click on apply setting.
You will be able to access the parent relationship queries.
This was very helpful. I needed to use Data loader to extract Accounts for 4 User roles. This info helped me create:
Select Id,Name,OwnerId FROM Account WHERE Owner.UserRole.Id IN('00E90000001ZHwfEAG','00E90000001ZHwkEAG','00E90000000Qfy2EAC','00E90000000Qfy7EAC')
Can you get this to show the profile name of the owner of an opportunity? I was not able to find the owner.profile.name when searching for field options in workbench
Try this query: SELECT Name, Owner.Name, Owner.UserRole.Name, Owner.Profile.Name FROM Opportunity in workbench. Don't look for fields as they are related fields.