PDI · Question #221
What is an example of a polymorphic lookup field in Salesforce?
The correct answer is D. The Whatld field on the standard Event object. A polymorphic lookup field is a special type of lookup that can refer to more than one object type, and the WhatId field on the standard Event object is a prime example of this functionality.
Question
What is an example of a polymorphic lookup field in Salesforce?
Options
- AThe Parentid field on the standard Account object
- BThe LeadId and ContactId fields on the standard Campaign Member object
- CA custom field, Link__c, on the standard Contact object that looks up to an Account or a
- DThe Whatld field on the standard Event object
How the community answered
(47 responses)- A2% (1)
- B2% (1)
- C4% (2)
- D91% (43)
Why each option
A polymorphic lookup field is a special type of lookup that can refer to more than one object type, and the `WhatId` field on the standard Event object is a prime example of this functionality.
The `ParentId` field on the standard Account object is a self-lookup field, meaning it always looks up to another Account record, not multiple distinct object types.
The `LeadId` and `ContactId` fields on the standard Campaign Member object are two separate, distinct lookup fields, each pointing to a specific object type (Lead or Contact), rather than a single polymorphic field.
A custom field `Link__c` that explicitly looks up to *either* an Account *or* a separate custom object would typically be implemented as two separate lookup fields, or a master-detail if applicable, and would not natively achieve polymorphic behavior for a single field without significant custom development and data modeling that doesn't define it as a polymorphic field type.
The `WhatId` field on standard Event and Task objects is a polymorphic lookup, meaning it can relate to multiple types of objects, such as an Account, Opportunity, or any other object that can be associated with an activity, enabling flexible record relationships.
Concept tested: Polymorphic lookup fields
Source: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/field_types.htm#field_types_polymorphic
Topics
Community Discussion
No community discussion yet for this question.