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
Board salesforceBoard salesforce 

Multiple Owners Query

Hi All,


can any one suggest on this
How to retrieve all the owners and i have to display it on the VF page?
 
Shaijan ThomasShaijan Thomas
Get all the owner ids in to a set, Query in user object and display in Visualforce page
Thanks
Board salesforceBoard salesforce
Thanks for the response Shaijan Thomas ,

sample query pls?
Thanks ,
Ram
Rajiv Penagonda 12Rajiv Penagonda 12
@Board Salesforce,

there are three options you may try:
1. Some standard objects support Owner.Name directly in the query. So if you want to show owners of Opportunity, Account, Contact etc in your VF page, you may use "SELECT Owner.Name FROM Opportunity" and show in VF page.
2. Get all the owner ids in to a set, Query in user object and display in Visualforce page (Same as solution from Shaijan Thomas above)
3. Create a formula field in your object as below:
IF(
  ISBLANK(Owner:User.Id), /* If blank, it's a queue */
  Owner:Queue.QueueName,
  Owner:User.FirstName & " " & Owner:User.LastName
)

and show that formula field in your VF page. More details here (https://success.salesforce.com/answers?id=90630000000grNgAAI)

Hope this helps

 
Ravi Dutt SharmaRavi Dutt Sharma
Can you please provide more details. You need owners of which object's record?