Set up global rules

Global rules define the default merge behavior for each document type. They determine which documents are automatically included when you print or email a sales order, invoice, purchase order, or other supported document.

Global rules are Level 1 in the rule hierarchy. They apply to all documents of a given type unless overridden by partner rules.

Open the global rules list

Choose the Search icon (Alt+Q), enter Doc. Merge Global Rules, and then choose the related link.

Alternatively, open the Doc. Merge Setup page and choose the Global Rules action.

Global rules list

Create a new rule

  1. On the Doc. Merge Global Rules page, choose the New Rule action.

  2. On the Doc. Merge Global Rule Card, fill in the fields as described in the following sections.

  3. Set the Active field to Yes when the rule is ready to use.

Global rule card

General fields

Field

Description

Document Type

The document type this rule applies to, for example S.Invoice or P.Order.

Sequence No.

The position in the merge order. Sequence 1 is reserved for the main report. Additional documents start at sequence 2.

Description

A free-text description of the rule for your reference.

Active

Enables or disables the rule. Inactive rules are ignored during document list building.

Attach Separately

When enabled, the document matched by this rule is attached as a separate email file instead of being merged into the PDF. Learn more at Email handling.

Source configuration

The Source Type field determines where the system looks for documents. Depending on the selected source type, different configuration fields become available.

Document Attachment

Matches files attached to the Business Central document through the standard Document Attachments feature.

Field

Description

File Name Pattern

Wildcard pattern to match file names. Use * for any characters and ? for a single character. Leave blank to match all files.

Exclude File Name Pattern

Comma-separated patterns to exclude. For example: Draft*,Internal*.

File Type Filter

Filter by file extension, for example pdf or pdf,jpg. Leave blank to include all types.

Examples:

Pattern

Matches

*

All files

Contract*

Contract_2024.pdf, Contract-signed.pdf

*.pdf

All PDF files (alternatively, use the File Type Filter)

Invoice_????.pdf

Invoice_0001.pdf, Invoice_2024.pdf

Incoming Document

Matches files linked through the Business Central Incoming Documents feature.

The same pattern matching fields are available as for Document Attachment.

BC Report

Includes a rendered Business Central report as PDF. You can specify the report directly or use a report reference template.

Field

Description

Report ID

The ID of the report to render. Use this for direct report inclusion.

Report Reference Entry No.

Links to a report reference template for cross-document lookups (for example, including shipment notes with an invoice).

Important Report ID and Report Reference are mutually exclusive. Use one or the other, not both.

Learn more about report references at Set up report references.

Static Document

Includes a pre-uploaded document from the Static Documents list.

Field

Description

Static Document Code

The code of the static document to include.

Learn more at Set up static documents.

Configuration status

The rule card displays a Configuration Status indicator:

Status

Meaning

Ready

The rule is fully configured and active.

Incomplete

Required fields are missing for the selected source type.

Inactive

The rule is disabled (Active = No).

Reorder rules

On the Doc. Merge Global Rules list page, use the Move Up and Move Down actions to change the sequence order. The sequence determines the position of documents in the merged PDF.

Delete a rule

On the Doc. Merge Global Rules list page, select the rule and choose the Delete Rule action.

Note Deleting a global rule does not affect existing document lists that were already built from that rule. To update existing documents, use the Rebuild action on the document composition.