I am using the REST API and SOQL to query an Org's CaseComment records, but I'm getting the "invalid cross reference id" error. Most of my search online shows this error occurring during inserts or updates, not queries. We are also able to run this query without any problems against other Orgs. The query looks like:

SELECT Id,ParentId,IsPublished,CommentBody,CreatedById,CreatedDate,SystemModstamp,
CreatorSmallPhotoUrl,CreatorName FROM CaseComment LIMIT 10000

What are the reasons this could happen during a SOQL query and what can be done to find the root cause?

  • 1
    You should never get that on query, you'll need to log a case with salesforce support
    – superfell
    Jun 2 '14 at 17:18

Hi welcome to the salesforce stack exchange community.

I've tried to execute your query in my developer org.

No such column 'CreatorFullPhotoUrl', 'CreatorSmallPhotoUrl', 'CreatorName'

The problem is related to Chatter answers

URL of the user’s profile photo from the feed. Chatter Answers must be enabled to view this field. - Case Comments - Salesforce Docu

In case Chatter Answers isn't enabled you should query for CreatedByID and use the "User" table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.