Loading
システム管理者に対するフィッシング耐性MFA・全従業員ユーザーMFAの適用のお知らせ 続きを読む

Formula Fields Cannot Be Used in Validation Rule Error Location in Salesforce

公開日: May 23, 2026
説明

Understanding Formula Fields and Validation Rules

  • Formula Fields: These fields derive their values dynamically based on a formula. The values are updated automatically whenever the referenced fields change.
  • Validation Rules: These rules check user-entered data and display error messages if the data does not meet certain criteria. The error message appears on a specified field where the user must take corrective action.

Why Formula Fields Cannot Be Used in Validation Rule Error Location Fields

  1. Formula Fields Are Not Editable: Users cannot manually enter or modify values in a formula field. Since validation rules are meant to enforce correct data entry, applying an error message to a formula field would not be meaningful.
  2. Error Messages Require User Input: Validation rules are designed to prompt users to correct their input. Since formula fields are system-generated, users would not have a way to fix an error triggered on such fields.
  3. System Logic Assumes No User Correction Needed: Because formula fields automatically calculate their values, Salesforce does not allow error messages to be applied to them through validation rules.
解決策
To work around this Salesforce Platform limitation, you can apply validation logic to editable fields instead of formula fields.
 
The following options are available:
  • Apply the validation rule to one of the editable fields that contribute to the formula field’s calculation.
  • Use Flow to notify users when an invalid condition is met.
  • Display a warning message using a custom validation method or UI enhancement, such as a Lightning Component.

For example, if you have a formula field Total_Price__c = Quantity__c * Unit_Price__c and want to trigger an error when the total exceeds $10,000, apply the validation rule to Unit_Price__c or Quantity__c instead.

その他のリソース

Validation Rule Considerations

 

ナレッジ記事番号

004461735

 
読み込み中
Salesforce Help | Article