nerdexam
Salesforce

PDI · Question #163

A custom picklist field, Food_Preference__c, exist on a custom object. The picklist contains the following options: 'Vegan','Kosher','No Preference'. The developer must ensure a value is populated…

The correct answer is C. Mark the field as Required on the field definition. To ensure a custom picklist field always has a value when a record is created or updated, marking the field as 'Required' in its field definition is the most efficient and robust solution.

Submitted by jian89· Apr 18, 2026Data Modeling and Management

Question

A custom picklist field, Food_Preference__c, exist on a custom object. The picklist contains the following options: 'Vegan','Kosher','No Preference'. The developer must ensure a value is populated every time a record is created or updated. What is the most efficient way to ensure a value is selected every time a record is saved?

Options

  • ASet "Use the first value in the list as the default value" as True.
  • BSet a validation rule to enforce a value is selected.
  • CMark the field as Required on the field definition.
  • DMark the field as Required on the object's page layout.

How the community answered

(44 responses)
  • A
    5% (2)
  • B
    2% (1)
  • C
    91% (40)
  • D
    2% (1)

Why each option

To ensure a custom picklist field always has a value when a record is created or updated, marking the field as 'Required' in its field definition is the most efficient and robust solution.

ASet "Use the first value in the list as the default value" as True.

Setting the first value as default populates the field initially but does not prevent users or processes from clearing the value before saving, thus not guaranteeing a value is always present.

BSet a validation rule to enforce a value is selected.

A validation rule could enforce the requirement but is less efficient and more complex to configure than simply marking the field as 'Required', which provides the same core functionality declaratively.

CMark the field as Required on the field definition.Correct

Marking a field as 'Required' in its field definition enforces that a value must be present upon record creation or update at the database level, ensuring data integrity across all entry points, including UI, API, and data imports.

DMark the field as Required on the object's page layout.

Marking a field as 'Required' on a page layout only enforces the requirement when that specific layout is used, failing to ensure data integrity when records are created or updated via other layouts or non-UI methods.

Concept tested: Enforcing required fields in Salesforce.

Source: https://help.salesforce.com/s/articleView?id=sf.custom_field_attributes.htm&type=5

Topics

#Field Properties#Data Integrity#Picklist Fields#Declarative Configuration

Community Discussion

No community discussion yet for this question.

Full PDI Practice