You need to sign in to do that
Don't have an account?

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
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.