Do I always need to specify the parent object for the polymorphic field?


Answer.

Yes. You should always specify parent object for polymorphic field.

See the examples:

"query": "SELECT Id, ParentId$Case FROM FeedItem WHERE Parent.Type = 'Case'"
"query": "SELECT Id, ParentId$Case, Name, Body FROM Attachment WHERE Parent.Type = 'Case'"

Since commonly the Plugin detects the referenced object type from the field metadata, but for the polymorphic field the parent object type is not defined in the field metadata, that is why parent object type could not be detected automatically and should be set in the query string.

Last updated on 29th Jan 2023