Skip to main content

[SELECT  id, owner.Any_Custom_Field_on_User__c

FROM      Task]

This is returning an error.
2 个回答
  1. 2019年8月24日 06:32
    Hi Akash

     

    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
0/9000