4.2 Fields, Formulas, Rollups, Validation, and Requiredness

Key Takeaways

  • Field type choices affect reporting, automation, integrations, conversion options, and data quality, so choose the narrowest type that represents the value accurately.
  • Formula fields calculate values and stay read-only, while validation rules block saves that do not meet business rules.
  • Native roll-up summary fields summarize child records only across master-detail relationships, so lookup reporting needs a different design or automation.
  • Requiredness can come from field definition, page layout, dynamic form behavior, validation rules, or automation, and each applies in a different context.
Last updated: May 2026

Field Design and Data Quality

A field is a contract between users, reports, automation, integrations, and future admins. In Object Manager, field creation starts with a data type, but the real decision is how Salesforce should understand the value. A date is different from text that looks like a date. Currency is different from number. Picklist is different from free text. These choices determine filtering, grouping, validation, formulas, imports, and integration behavior.

Choose the most specific field type that honestly represents the data. Use picklists when values should be controlled and reported consistently. Use checkbox fields for true or false flags. Use lookup or master-detail relationships when the value is another record, not a name typed into text. Use long text only when the business needs narrative detail that is not meant for grouping or precise reporting.

Field type changes can be restricted after data exists or after metadata depends on the field. A casual text field used by flows, formulas, reports, and integrations can become hard to replace. Good admins ask about the reporting question, import source, validation rule, automation use, and expected future values before creating the field.

NeedBetter toolWhy it fits
Calculate age from a dateFormula fieldThe value should update automatically and not be edited.
Prevent close date in the past for open opportunitiesValidation ruleThe rule blocks invalid saves across supported entry points.
Count related detail recordsRoll-up summary fieldNative roll-ups work across master-detail relationships.
Require a value only for one sales processValidation rule or layout by record typeThe requirement is conditional, not universal.
Show different fields to different usersField-level security and page designVisibility must respect security, not only layout preference.

Formula fields are read-only calculations. They can reference fields on the same record and, in many cases, parent fields through relationships. They are useful for labels, scoring, aging, status indicators, and derived values. A formula is not a place to store history, because it recalculates when referenced data changes. If the business needs the value as it was at a point in time, automation that writes to a stored field may be more appropriate.

Roll-up summary fields are summaries on the master record that aggregate detail records. Common choices include count, sum, minimum, and maximum, depending on the child field type. The key exam point is relationship type: native roll-up summary fields require master-detail. If the relationship is lookup, the admin may need a report, a custom report type, Flow, or another approved tool, but the native roll-up summary field is not available in the same way.

Validation rules evaluate record data and return an error when the rule condition is true. They are strong for business rules such as requiring a reason when status changes to Rejected, preventing an end date before a start date, or requiring a competitor when an opportunity is marked lost. Write the error message for the user, not for the formula author. Place it near the field when possible.

Requiredness has several layers. A universally required custom field at field definition is enforced broadly and should be used sparingly because existing records, imports, integrations, and automation must provide a value. A page layout required field mainly guides users in that page experience. A Dynamic Forms field can be configured as required in its component context. A validation rule is best when the requirement is conditional, such as requiring an implementation partner only for enterprise deals.

Required mechanismBest useTrap
Field required settingAlways required for every record of that objectCan disrupt imports and integrations if added without data cleanup.
Page layout requiredRequired in a specific layout-driven user experienceDoes not replace data quality controls for every save path.
Dynamic Forms requiredRequired in a Lightning page field component contextVisibility and requirement behavior must be tested by app, record type, and form factor.
Validation ruleRequired only when conditions are metA poorly written rule can block admins, automation, or data loads unexpectedly.

Admins should also think about help text, description, default value, field-level security, history tracking, and external IDs. Help text supports users. Description supports future admins. Field-level security controls who can see or edit the value. External IDs and unique fields support integration and deduplication patterns. History tracking can help audit important changes, but it should be reserved for fields where change history has business value.

A reliable field build workflow is:

  1. Identify the business question the field answers.
  2. Choose the field type and allowed values.
  3. Decide whether the value is entered, calculated, summarized, or derived by automation.
  4. Configure field-level security for the right users.
  5. Add the field to layouts, Lightning pages, compact layouts, reports, and search layouts as needed.
  6. Add validation only after testing realistic create, edit, import, and automation paths.
  7. Create sample records and confirm reporting behavior.

The exam often describes the same business requirement with slightly different language. If the value must be calculated and not edited, think formula. If the value must summarize child records and the relationship is master-detail, think roll-up summary. If the save should be blocked when data is invalid, think validation rule. If the issue is that users cannot see or edit a field, check field-level security before blaming page layout.

Test Your Knowledge

A support manager wants a Case field to show how many related Case Comment detail records exist, and the relationship is master-detail. Which feature is the best fit?

A
B
C
D
Test Your Knowledge

An admin needs to require a Lost Reason only when an Opportunity stage is Closed Lost. Which approach is usually the best fit?

A
B
C
D
Test Your Knowledge

Which field type is best when users must select one approved customer tier value for reporting consistency?

A
B
C
D