How can query Opportunity Owner Name?
I tried:
public List<Opportunity> opportunity{get;set;}
opportunity = [SELECT Name,OwnerId
FROM Opportunity
];
But I only need first and last name.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityCan you use the below query. Ownerid
will return only the id of the owner. You have to use Owner.name
as below.
SELECT id ,name,owner.Name,ownerid from opportunity