How KodeWitz built a configurable, metadata-driven validation framework on Salesforce LWC — giving admins full control over stage-based field requirements, record types, and toggle switches, all without developer involvement.
As business processes evolved, the organisation needed to enforce different mandatory fields at different record stages — but every change required a developer to modify Apex code or Salesforce validation rules. What should have been a quick admin task turned into a development ticket, testing cycle, and deployment.
There was no single place to see or control all validation logic. Rules were scattered across multiple validation rule configurations, page layouts, and Apex triggers — making them impossible to audit, easy to break, and painful to maintain. When requirements changed, the cycle started all over again.
Developer dependency — every new or updated validation rule required a developer, a code change, and a deployment cycle
Scattered validation logic — rules spread across validation rules, Apex triggers, and page layouts with no centralised control or visibility
No on/off switch — disabling a validation for testing or a specific scenario required code changes, not a simple toggle
Poor user experience — users hit cryptic error messages mid-stage-transition with no guidance on what fields needed to be filled
Incomplete data quality — without enforced field requirements at stage transitions, records moved forward with missing critical data
The framework fundamentally changed how validations are managed — from a developer problem to an admin superpower.
A fully configurable LWC component backed by a custom metadata object — giving admins complete control over validation rules without touching a single line of Apex.
A Generic Validation custom object stores all validation rules as data records. Admins define mandatory fields, target record types, applicable stages, and active/inactive status — all through standard Salesforce record management, no code required.
Rules stored as Custom Object records — configurable by admins via Salesforce UI — zero deployment needed
The LWC component intercepts stage transitions and dynamically evaluates which fields are mandatory for the target stage and record type. Validations are context-aware — different stages and record types can have completely different rules.
Rules evaluated at stage transition time — filtered by record type + stage combination dynamically
Every validation rule has an active/inactive toggle. Admins can instantly enable or disable any rule without a deployment — ideal for testing scenarios, temporary exceptions, or phased rollouts of new validation requirements.
Active flag on Custom Object record — toggled by admin in seconds, no code change
When a user attempts a stage transition with missing mandatory fields, a single focused pop-up appears listing exactly what needs to be filled. Users can complete the fields inline and proceed — no navigation away from the record, no confusion.
LWC modal lists missing fields clearly — inline update and re-validation in one pop-up
Every stage transition passes through the validation engine — users are guided to completion, not blocked without explanation.
The framework eliminated the developer bottleneck for validation changes — and improved data completeness across every stage transition.
Improved data quality — mandatory field enforcement at every stage means no more incomplete records moving forward
Better user experience — smart pop-up tells users exactly what to fill, eliminating cryptic error messages
Instant toggle control — admins can enable or disable any rule in seconds for testing, exceptions, or rollouts