Skip to main content
Apragya AIFree quotation builderQuotation builderQuote builderno signup
How-to guide

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.

An accountant examining a supplier bill closely

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.

  1. List the document types you process and the fields each must carry.
  2. Mark essential fields as required with error severity.
  3. Write format patterns for identifiers such as GSTIN and PAN.
  4. Add warning rules for fields that help but are not essential.
  5. Scope every rule to the right document types.
  6. 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

  1. A bill without it never completes on its own.

  2. Fifteen characters in the expected shape.

  3. Needed to trace the bill later.

  4. Needed for the right tax period.

  5. Recorded, but does not hold the bill.

  6. Receipts and forms follow their own rules.

Error rules hold a bill for review; warning rules are recorded without holding it.

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.

A tray with a large neat stack and a small clipped pile of sheets
Most bills moved straight on; the clipped pile held the nine that failed an error rule.

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.

  1. Scope by document type: Each rule applies to chosen document types, or to all of them.
  2. Required fields: A field check fails when a named field is missing or empty.
  3. Format patterns: A pattern check fails when a value does not match the shape you set.
  4. Severity: Rules are error, warning or info; an error failure keeps the document out of automatic completion.
  5. Results on the document: Each run records pass, fail, warning or skipped with a message, and failures go to review.

Getting started

  1. List the fields a document cannot do without, per document type.
  2. Make those required, with error severity.
  3. Add format patterns for identifiers such as GSTIN and PAN.
  4. Add warning rules for fields that are useful but not essential.
  5. 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

FeatureManual checksApragya validation rules
When checks runWhen someone has timeAs each document is read
Missing fieldsFound at return timeHeld on arrival
Format errorsSpotted by eyeCaught by a pattern
Minor gapsSame as major onesWarning, not a hold
EvidenceA tick on a listA result per rule on the document
Who changes rulesNot applicableAn 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

INR 7,999
Pro, a month
Up to 25 users, with Intelligent Document Processing and every enterprise app
5,000
AI Credits a month
Included on Pro
Free
Up to 3 users
CRM and HR, to try the platform first

Creating validation rules, answered

Can we write our own rules?
Yes. Rules are configuration: the field, the check, a pattern where needed, the severity and the document types.
What happens when a document fails?
If the rule is error level, the document is kept from completing on its own and goes to review with the result recorded.
Does a warning hold the document?
No. Warnings and info results are recorded on the document without holding it.
Do rules check amounts against the purchase order?
Matching against the PO and goods receipt happens in Purchase and Payables, which compares bill totals.
What does it cost to start?
Intelligent Document Processing comes with the Pro plan, INR 7,999 a month for up to 25 users, which includes every enterprise app, 5,000 AI Credits a month, single sign-on and audit logs. The free plan covers up to 3 users with CRM, HR and Vendor Onboarding if you want to try the platform first.

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.