Skip to main content

Code reviews rule: Missing custom fields description

Written by David Martin
Updated this week

Missing custom fields description

Why is this an issue?

Custom fields without descriptions are harder to understand and maintain. Field descriptions appear in:

  • The field's detail page in Setup

  • Field-level help when users hover over the field

  • API documentation

Good descriptions help users enter correct data and help developers understand the field's purpose.

Examples

Example of incorrect metadata (no description):

<CustomField>
<fullName>Priority_Score__c</fullName>
<label>Priority Score</label>
<type>Number</type>
<!-- No description -->
</CustomField>

Example of correct metadata (with description):

<CustomField>
<fullName>Priority_Score__c</fullName>
<label>Priority Score</label>
<description>Calculated score (1-100) based on account revenue and engagement.
Higher scores indicate accounts that should be prioritized by sales.</description>
<type>Number</type>
</CustomField>

How can I fix violations?

Add a description to each custom field:

  1. Navigate to Setup > Object Manager > [Object] > Fields & Relationships

  2. Click on the field name

  3. Click Edit

  4. Add a description and optionally help text

  5. Click Save

When should I disable this rule?

You may dismiss specific violations for fields with self-explanatory names where a description would be redundant.

Resources

Did this answer your question?