Skip to content

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?

  1. Open the Mandatory Field Setup page.
  2. Click New to add a new line.
  3. 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.

  4. In the Field Name column, use the lookup — a list of fields for the selected table opens.
  5. Select the field that must be filled in before posting.
  6. Make sure the Enabled column is checked (enabled by default).
  7. 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

ColumnDescription
Page No.The page number where users enter data (e.g. 42 = Sales Order). Use the lookup to select.
Page NameName of the selected page — filled in automatically, cannot be edited manually.
Table NameName of the underlying table for the selected page — filled in automatically.
Field NameThe field that must be filled in. Use the lookup to select from the fields of the selected table.
EnabledCheck 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:

  1. The document header — all mandatory fields configured for the header table (e.g. Sales Header).
  2. Each document line — individually.
  3. 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

MessageCauseSolution
Field "X" on Y must not be empty.Field X on page/table Y is emptyOpen 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. selectedSelect 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?

  1. In the rule card, click New Line inside the Conditions section.
  2. In the Condition Type column, choose Include or Exclude (see table below).
  3. In the Filter Field column, use the lookup to select the field to filter on (e.g. Gen. Bus. Posting Group).
  4. In the Filter Value column, enter a value or use the lookup if the field is linked to a list.
  5. Repeat for each additional condition.

Conditions column reference

ColumnDescription
Condition TypeInclude or Exclude — controls how the condition is applied (see logic explanation below).
Filter FieldThe field on the source card (e.g. customer or vendor) whose value is evaluated. Use the lookup to select.
Filter ValueThe value that field must have for the condition to be met (e.g. DOMESTIC).

How Include and Exclude work

Condition TypeMeaning
IncludeThe rule applies only if all Include conditions are simultaneously met (AND logic).
ExcludeThe 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 TypeFilter FieldFilter Value
IncludeGen. Bus. Posting GroupDOMESTIC

→ 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 TypeFilter FieldFilter Value
IncludeGen. Bus. Posting GroupDOMESTIC
IncludeVAT Bus. Posting GroupFULL

→ Validation applies only to customers who are both DOMESTIC and FULL (both conditions must be met simultaneously).


Example 3 — Exclude a specific group

Condition TypeFilter FieldFilter Value
ExcludeGen. Bus. Posting GroupK-INO

→ The rule applies to all customers except those with posting group K-INO.


Example 4 — Exclude a specific customer

Condition TypeFilter FieldFilter Value
ExcludeNo.CUST00001

→ For customer CUST00001, validation never runs regardless of other settings.

Factory d.o.o.