How to Create Validation Rules in an ERP: Stop Bad Document Data Before It Posts
For finance and back-office teams reading invoices, receipts and forms with AI: set rules so missing or malformed data waits for a person instead of reaching the books.
Learning how to create validation rules in an ERP is how you make document automation safe to switch on. A rule is a question every document must answer before it moves on: is the GSTIN present and in the right format, is there an invoice number, is the date there at all.
Without rules, a bill with a missing field posts quietly and the gap surfaces weeks later, when a return does not reconcile or a payment cannot be traced. By then the person who handled it has forgotten the document.
This guide explains how to design validation rules, an illustrative setup at a Ludhiana hosiery exporter, and how Apragya's document processing app runs them.
How to create validation rules, step by step
A validation rule is a condition that data must meet before it is accepted. In document processing the data comes from a machine reading a PDF or photo, so rules catch what the reader missed or got wrong before anyone relies on it.
Most useful rules fall into two kinds. Required checks fail when a field is empty, such as an invoice number or supplier GSTIN. Format checks fail when a value has the wrong shape, such as a GSTIN that is not fifteen characters of the expected pattern.
Give each rule a severity. Errors should hold the document for a person. Warnings should be recorded without holding it. Scope each rule to the document types it applies to, so a receipt is not held for lacking a purchase order reference.
- List the document types you process and the fields each must carry.
- Mark essential fields as required with error severity.
- Write format patterns for identifiers such as GSTIN and PAN.
- Add warning rules for fields that help but are not essential.
- Scope every rule to the right document types.
- Review failures weekly and retire rules that only create noise.
What unchecked document data costs
Missing fields posted
Bills without an invoice number or GSTIN reach the books.
Found at month end
Gaps surface when returns do not agree.
Rework later
Someone has to find the original document again.
Weak audit answers
Nobody can show what was checked and when.
An example: a Ludhiana hosiery exporter sets its rules
Take an illustrative exporter of woollen knitwear that reads about 600 supplier bills a month with AI. Some came through without an invoice number or with a GSTIN missing a character, and those were only found at the GST return.
The rules the exporter set for supplier bills
Rules for supplier bills
A bill without it never completes on its own.
Fifteen characters in the expected shape.
Needed to trace the bill later.
Needed for the right tax period.
Recorded, but does not hold the bill.
Receipts and forms follow their own rules.
In the first month nine bills failed an error rule and waited for an operator, who fixed each while the PDF was still open. The PO warning showed which suppliers never quote an order number, and the purchase team took that up with them directly.
How data validation rules in ERP run in Apragya
Step 1 of 5
Scope by document type
Each rule applies to chosen document types, or to all of them.
- Scope by document type: Each rule applies to chosen document types, or to all of them.
- Required fields: A field check fails when a named field is missing or empty.
- Format patterns: A pattern check fails when a value does not match the shape you set.
- Severity: Rules are error, warning or info; an error failure keeps the document out of automatic completion.
- Results on the document: Each run records pass, fail, warning or skipped with a message, and failures go to review.
Getting started
- List the fields a document cannot do without, per document type.
- Make those required, with error severity.
- Add format patterns for identifiers such as GSTIN and PAN.
- Add warning rules for fields that are useful but not essential.
- Read the first week's failures and adjust the rules.
Start small. Three good error rules catch most of what costs money.
Invoice data validation: by hand or by rule
Checking by hand happens when someone has time, usually at month end. Rules run on every document as it is read, so a clean bill moves on at once and only the failures wait. Severity lets you hold what matters without blocking on what does not.
Checking by hand, compared with Apragya
| Feature | Manual checks | Apragya validation rules |
|---|---|---|
| When checks run | When someone has time | As each document is read |
| Missing fields | Found at return time | Held on arrival |
| Format errors | Spotted by eye | Caught by a pattern |
| Minor gaps | Same as major ones | Warning, not a hold |
| Evidence | A tick on a list | A result per rule on the document |
| Who changes rules | Not applicable | An administrator, without code |
Checked against public information on 16 September 2026.
Setting up a GSTIN format check and other rules
Built for Indian documents
GSTIN, invoice numbers and dates are the usual first rules.
Configuration, not code
Fields, checks, patterns and severity are set by you.
Low confidence too
Uncertain reads go to review even when rules pass.
Matching in payables
Bill totals are compared with the PO and goods receipt in Purchase and Payables.
Audit log
Actions are logged with user, role and time.
Agents suggest, people decide
Anything carrying money waits for human review.
Rules run on what document extraction reads and on extraction templates. Read the validation rules software page, and see how to create supervisor review for what happens to failures.
What it costs to start
Creating validation rules, answered
Can we write our own rules?
What happens when a document fails?
Does a warning hold the document?
Do rules check amounts against the purchase order?
What does it cost to start?
Catch the missing field while the document is still open
Set your first error rules for supplier bills and read what they catch in week one.