You need to sign in to do that
Don't have an account?
Akash Punera
This is returning an error.
Custom fields on user not accessible in soql for task object via owner lookup
[SELECT id, owner.Any_Custom_Field_on_User__c FROM Task]
This is returning an error.
Greetings to you!
No, you can not use the custom field of the owner in Query. Also, you can not use all the standard field of the owner in Query. Only limit fields which are global like Owner.Id, Owner.Username, Owner.LastName ,Owner.FirstName ,Owner.Name, Owner. Title, Owner. Email etc can be used in Query.
If you required those field in the query you can create Formula field like Owner:User.custom_field__c .
So I added a custom formula field named Owner_Primary_Functions__c to Task object to represent the field value from related User objects for Task records. In my case, the formula was TEXT(Owner:User.Primary_Functions__c).
Now, this query works for me:
SELECT Id, Subject, Owner.Name, Owner_Primary_Functions__c FROM Task
Thanks
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com