Skip to main content

Dear fellow trailblazers,

 

I have an issue that puzzles me quite a lot these days!

 

I have this query as follows:

Select Id, Name, Persona.Name, ParentId, ReplyTo.ParentId, Parent.Name, ReplyTo.Parent.ContactId From SocialPost Where Name like 'Inbox Message from: Dale Test to%'

But I keep getting this error?

INVALID_FIELD:

ReplyTo.ParentId, Parent.Name, ReplyTo.Parent.ContactId From SocialPost

^

ERROR at Row:1:Column:73

No such column 'ContactId' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

In this case:

1. ReplyTo is a lookup to the records hierarchical parent (i.e. SocialPost)

2. Parent is of type Lookup(Question,Reply,Case) but in this case I want to reference the related Case

And as you can see I was just trying to grab the Contact Id of that Case record of the ReplyTo social post. Since they're all standard objects, so no need for '__r' suffix

 

I remember we can go up 5 levels in this type of queries but not sure why it fails. Although Salesforce Inspector can see all the fields in its suggestions.

 

Would be very appreciated if anyone can shed some light!

 

Thank you for your time on my question!

 

Cheers

Dale

 

#Social Studio #SocialStudioTips #Social Customer Service #Service Cloud #SOQL Queries

8 件の回答
  1. 2021年9月28日 22:50

    Hey @Karan Kehar,

     

    I'll have to get back to this to try the suggested method. Little busy these days.

     

    I appreciated all the answers. :)

     

    Cheers

    Dale

0/9000