Is it necessary to always specify the parent object for a polymorphic field?


Answer.

Yes, you should always specify the parent object for polymorphic fields.

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'"

Typically, the plugin detects the referenced object type from the field metadata.

However, for polymorphic fields, the parent object type is not defined in the field metadata. Therefore, the parent object type cannot be detected automatically and must be explicitly specified in the query string.

Last updated on 18th Apr 2024