Skip to content
forcedotcom avatar

Platform Validation Rule Generate

Declarative Salesforce validation rule builder that writes, edits, and checks error-condition formulas with metadata XML.

CCM score
63 of 100
skills.sh installs
6.5K
GitHub stars
1.2K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers creating, modifying, and validating Validation Rules, including formula updates and deployment error troubleshooting
  • Specifies rule properties (fullName, active, errorConditionFormula, errorMessage) with naming and 255-character message limits
  • Enforces function-specific rules for TEXT, CASE, VALUE, DAY, MONTH, DATEVALUE, ISPICKVAL, and ISCHANGE, and CDATA wrapping for formulas containing XML
  • Designed for Salesforce admins and developers who need data-layer business rules; output files use the .validationRule-meta.xml extension

Install

$ npx -y skills add forcedotcom/sf-skills --skill platform-validation-rule-generate -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

When to Use This Skill

Use this skill when you need to:

  • Create validation rules to enforce data quality
  • Prevent invalid records from being saved
  • Generate validation rule metadata with formulas
  • Add business logic validation to objects
  • Troubleshoot deployment errors related to validation rules

Specification

ValidationRule Metadata Specification

Overview

Validation Rules are declarative metadata components used to enforce data quality and business logic in Salesforce. They evaluate a formula expression when a record is saved and prevent the save operation if the expression returns TRUE.

Purpose

-Enforce business rules at the data layer -Prevent invalid or incomplete records from being saved -Display meaningful error messages to guide users

Required Properties

Core Validation Rule Properties
  • fullName
    • The unique API name of the validation rule
    • Must start with a letter
      • Can contain letters, numbers, and underscores
    • Cannot end with an underscore
    • Cannot contain consecutive underscores
    • Cannot exceed 40 character.

Details

Repository
github.com/forcedotcom/sf-skills
Category
Backend & APIs
First seen
Jul 14, 2026

Questions

What does the platform-validation-rule-generate skill do?

It creates, modifies, and validates Salesforce Validation Rules, which evaluate a formula when a record is saved and block the save when the formula returns TRUE. It also writes the rule metadata with formulas and error messages, and helps troubleshoot validation rule deployment errors.

How do I install the platform-validation-rule-generate skill?

Run npx -y skills add forcedotcom/sf-skills --skill platform-validation-rule-generate -y in your project. Once installed, the agent can handle validation rule work such as enforcing business rules at the data layer.

When should I use the platform-validation-rule-generate skill?

Use it when you need to enforce data quality on Salesforce objects, prevent invalid records from being saved, or fix validation errors. It also applies when you need to update a validation formula or add business logic validation.

More from forcedotcom/sf-skills

All 78

Similar to Platform Validation Rule Generate

More Backend & APIs