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
Neelima KongathiNeelima Kongathi 

how to retrieve a custom field in user object through custom object owner field using soql??

List<Consultant__c> toBeSubmittedCons = [select id,Pan_Number__c,category__c,Phone__c,Email__c,System_otp__c,owner.IT_HEAD__c,owner.NON_IT_HEAD__c from Consultant__c];

custom object : Consultant__c
custom fields in user object
1.IT_HEAD__c : lookup to user
2.NON_IT_HEAD__c :lookup to user
Hi Neelima,

I think you won't get the custom field value of the user . Store the Owner id in the list and query again the into the USER object to get the record. Thanks.