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

Yes. You always must specify the parent objects for the polymorphic lookup fields for example

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


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

because in general the Plugin extracts the referenced object type from the field metadata, but for the polymorphic field the parent type is not defined in the field metadata.

So, for the polymorphic field the Plugin can't bind the lookup field to the parent object and the execution will fail.

Last updated on Sa Oct 2022