Mandatory Fields at Posting
This module allows administrators to define which fields must be filled in before a sales or purchase document can be posted. Rules are configured once and then applied automatically on every posting.
Setting up mandatory fields
Where is it?
Search for Mandatory Field Setup in the Business Central search bar.
How to add a rule?
- Open the Mandatory Field Setup page.
- Click New to add a new line.
- In the Page No. column, use the lookup to select a page (e.g. Sales Order, Customer Card, Item Card).
The Page Name and Table Name columns fill in automatically.
- In the Field Name column, use the lookup — a list of fields for the selected table opens.
- Select the field that must be filled in before posting.
- Make sure the Enabled column is checked (enabled by default).
- Repeat steps 2–6 for each additional field.
Order of entry
The Page No. column must be selected before the Field Name column. If you try to open the field lookup without a page selected, the system shows:
"Please select a page before selecting a field."
Column reference
| Column | Description |
|---|---|
| Page No. | The page number where users enter data (e.g. 42 = Sales Order). Use the lookup to select. |
| Page Name | Name of the selected page — filled in automatically, cannot be edited manually. |
| Table Name | Name of the underlying table for the selected page — filled in automatically. |
| Field Name | The field that must be filled in. Use the lookup to select from the fields of the selected table. |
| Enabled | Check to activate the rule. Uncheck to temporarily disable validation without deleting the line. |
How validation works at posting
Validation runs automatically before posting the following document types:
- Sales documents (order, invoice, credit memo, return order)
- Purchase documents (order, invoice, credit memo, return order)
- Sales and purchase prepayments
The system checks:
- The document header — all mandatory fields configured for the header table (e.g. Sales Header).
- Each document line — individually.
- Related cards — if a field on the header or a line points to another table (e.g. customer, vendor, item), the system also checks mandatory fields on that card.
If one or more mandatory fields are empty, posting is blocked and a combined message listing all violations is shown.
Error messages
| Message | Cause | Solution |
|---|---|---|
Field "X" on Y must not be empty. | Field X on page/table Y is empty | Open the document or the relevant card and fill in the field |
Please select a page before selecting a field. | Attempted to select a field in Mandatory Field Setup without a Page No. selected | Select the page in the Page No. column first, then select the field |
Multiple errors at once
If more than one mandatory field is empty, the system lists all of them in a single message. Fix all listed fields before attempting to post again.
Rule conditions
Each rule can have conditions that control which records it applies to. Without conditions, a rule applies to all records in the table. Conditions let you narrow it to specific groups or exclude certain records.
Where to configure?
In the Mandatory Field Setup list, click the arrow → on the left side of a row. The rule card opens with a Conditions subpage at the bottom.
How to add a condition?
- In the rule card, click New Line inside the Conditions section.
- In the Condition Type column, choose Include or Exclude (see table below).
- In the Filter Field column, use the lookup to select the field to filter on (e.g. Gen. Bus. Posting Group).
- In the Filter Value column, enter a value or use the lookup if the field is linked to a list.
- Repeat for each additional condition.
Conditions column reference
| Column | Description |
|---|---|
| Condition Type | Include or Exclude — controls how the condition is applied (see logic explanation below). |
| Filter Field | The field on the source card (e.g. customer or vendor) whose value is evaluated. Use the lookup to select. |
| Filter Value | The value that field must have for the condition to be met (e.g. DOMESTIC). |
How Include and Exclude work
| Condition Type | Meaning |
|---|---|
| Include | The rule applies only if all Include conditions are simultaneously met (AND logic). |
| Exclude | The rule is skipped if any Exclude condition is met (OR logic). |
Exclude takes precedence
If any Exclude condition matches, the rule is skipped — even if all Include conditions also match.
Examples
Example 1 — Rule only for domestic customers
| Condition Type | Filter Field | Filter Value |
|---|---|---|
| Include | Gen. Bus. Posting Group | DOMESTIC |
→ The VAT Registration No. is required only for customers with posting group DOMESTIC. For all others, the check is skipped.
Example 2 — Rule for domestic customers with full VAT
| Condition Type | Filter Field | Filter Value |
|---|---|---|
| Include | Gen. Bus. Posting Group | DOMESTIC |
| Include | VAT Bus. Posting Group | FULL |
→ Validation applies only to customers who are both DOMESTIC and FULL (both conditions must be met simultaneously).
Example 3 — Exclude a specific group
| Condition Type | Filter Field | Filter Value |
|---|---|---|
| Exclude | Gen. Bus. Posting Group | K-INO |
→ The rule applies to all customers except those with posting group K-INO.
Example 4 — Exclude a specific customer
| Condition Type | Filter Field | Filter Value |
|---|---|---|
| Exclude | No. | CUST00001 |
→ For customer CUST00001, validation never runs regardless of other settings.