You need to sign in to do that
Don't have an account?
Rodrigo_Rocha
SOQL query to retrieve custom field from record owner.
Hi all,
We have a custom field in the User object called Position__c. My goal is to write a query on the LEAD object and include this (maybe more) custom fields from the USER (Owner) object.
I know I can write a query like: "SELECT Id, Owner.Name FROM Leads" and that would return the owner name, but when I try to use Owner.Position__c I get an error.
Through a custom report type, custom fields (via lookup) from the User (Owner) isn't available. I could pottentialy create a custom formula field on the Lead object to retrieve this data and use it in a report, but we are trying to accomplish this without creating a new custom formula field.
Eventually I would need to group this report (query) like:
Position
|> Onwer Name
|> Lead Name
Any idea?
Thanks,
Rodrigo
We have a custom field in the User object called Position__c. My goal is to write a query on the LEAD object and include this (maybe more) custom fields from the USER (Owner) object.
I know I can write a query like: "SELECT Id, Owner.Name FROM Leads" and that would return the owner name, but when I try to use Owner.Position__c I get an error.
Through a custom report type, custom fields (via lookup) from the User (Owner) isn't available. I could pottentialy create a custom formula field on the Lead object to retrieve this data and use it in a report, but we are trying to accomplish this without creating a new custom formula field.
Eventually I would need to group this report (query) like:
Position
|> Onwer Name
|> Lead Name
Any idea?
Thanks,
Rodrigo
If you don't want to create additional fields (like you have mentioned above), I would recommend following code:
Hope this helps!