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
jpbenjpben 

SOQL query for Case Owner Name

Need help with SOQL query.  I am trying to run the query below and I am getting an error with the "Owner.Name" on my query.  I am trying to get the Owner Name instead of OwnerID on my extract.   Data Loader is giving the following error message, "Internal error.  Cannot parse field expression owner.name".  I am using Data Loader 23.0.  Please advice.  

 

SELECT Owner.Name, Case.Account.Parent.Name, Case.Account.Parent.Account_ID__c, Account.Name, Account_ID__c, Type, CC_Case_Reason__c, CreatedDate, ClosedDate, CreatedBy.Name, LastModifiedBy.Name, LastModifiedDate, Subject, Customer_Urgency__c, Customer_Feedback__c, Product_Group__c, Sub_Product_Group__c, CaseNumber  FROM Case  WHERE RecordTypeId = '012A0000000dFKZ' AND CreatedDate = LAST_N_DAYS:30

Shiva Ramesh @ xcdhrShiva Ramesh @ xcdhr

Hi Jpben

 

I think we cant use Owner.Name instead of OwnerID. Because, Owner field is a reference ID field of User object. If you need a owner name. Create one formula text field on Case object and get $User.FirstName and $User.LastName in that. After that use this custom formula field API name on your Extract query.

jpbenjpben

Hi Shiva,

 

I tested this.  It doesn't solve the issue.  The Case Owner could be a queue so it doesn't necessarily use the User object.  

 

-John- 

Shekhar DautpureShekhar Dautpure
Dear jpben 

Just use Owner.name in the select of your soql. This should give you the owner name. 

if the answer solve your question, please mark the answer. 
Anshu MishraAnshu Mishra
Thanks Shekhar Dautpure. It works!!