What this view is for
Invoice.meta_codes provides the classification, status and commercial context for invoices.
If:
Invoice.core_detailsdefines what the invoice is
then meta_codes explains how the invoice should be interpreted, including its status, type, numbering context, payment terms and links back to upstream objects.
This view is essential for understanding why an invoice looks the way it does and how it should be treated in reporting.
Level of detail (grain)
- Multiple rows per invoice
- One row per code attribute
This view is intentionally long and thin.
A single invoice will appear multiple times — once for each coded attribute.
This structure allows invoice classifications to evolve without changing the schema.
What you’ll find in this view
Each row represents a single coded attribute for an invoice and typically includes:
OBJECT_SEQ– the paired company + invoice identifierMETA_TYPE– the category of the codeATTRIBUTE– the specific attribute name- A value payload (often code + description)
The meaning of any value always comes from the META_TYPE + ATTRIBUTE combination.
How to join this view
Every row includes OBJECT_SEQ, consistent with all Invoice views.
Always join Invoice.meta_codes to Invoice.core_details using OBJECT_SEQ.
This ensures:
- Attributes stay aligned to the correct invoice
- Cross-company joins are avoided
- Join patterns remain consistent across the Sales Pipeline model
Working with the long, thin structure
Like other meta_codes views, this table is designed for flexibility rather than immediate consumption.
In most reports, you will want to:
- Filter to the code types you actually need
- Create a combined attribute identifier
- Pivot to a wide, report-friendly shape
Creating a combined code attribute
Because META_TYPE provides essential context, it is strongly recommended to combine it with ATTRIBUTE.
Example (Power Query):
= Table.AddColumn(
Source,
"CODE_ATTRIBUTE",
each [META_TYPE] & "_" & [ATTRIBUTE],
type text
)
This avoids ambiguity (for example, multiple status-related codes) and makes pivoting predictable.
Pivoting to a wide attributes table
Once combined, pivoting allows you to:
- Turn each
CODE_ATTRIBUTEinto a column - Reduce each invoice to a single row
- Work with explicit, recognisable fields in visuals and filters
This shape is typically far easier to work with in reports.
Codes Helper for slicers
For slicers, it is often cleaner to build a small Codes Helper table rather than slicing directly from the long-thin data.
A Codes Helper:
- Provides a distinct list of codes and descriptions
- Avoids bringing invoice grain into slicers
- Keeps filtering behaviour predictable
The same helper pattern used for Busopp and Order applies here.
Codes currently available in Invoice meta_codes
The following META_TYPE / ATTRIBUTE combinations are available:
| META_TYPE | ATTRIBUTE |
|---|---|
| STATUS | INVOICE_VERSION |
| STATUS | ROWSTATE |
| STATUS | SEND_STATUS |
| STATUS | CREATE_STATE |
| TYPE | INVOICE_TYPE |
| TYPE | PRICE_ADJUSTMENT |
| TYPE | CORRECTION_REASON_ID |
| NUMERATION | CURRENCY |
| NUMERATION | TAX_ID_TYPE |
| TERMS | PAY_TERM_ID |
| TERMS | PAY_TERM_BASE_DATE |
| TERMS | WAY_PAY_ID |
| LINK_KEY | CUSTOMER_ID |
| LINK_KEY | PRU_CODE |
| LINK_KEY | ORDER_NO |
| LINK_KEY | PROJECT_ID |
How these are typically used
These attributes support questions such as:
- What state is the invoice in (created, sent, corrected)?
- Is this a standard invoice, adjustment or correction?
- Which currency and tax regime applies?
- What payment terms govern the invoice?
- Which customer, order or project does this invoice relate to?
They are commonly paired with:
Invoice.meta_datesfor billing and due timingInvoice.item_values_linesfor invoiced amounts- A Codes Helper table for slicers
Things to watch out for
- Don’t assume one row equals one invoice — always consider grain
- Always anchor joins through
Invoice.core_detailsusingOBJECT_SEQ - Be deliberate about which attributes you pivot and expose
If invoice counts change unexpectedly after adding codes, revisit joins and shaping first.
Where this fits in a report build
A typical flow is:
- Start with Invoice.core_details
- Join Invoice.meta_codes for classification and context
- Shape or pivot attributes as required
- Add meta_dates and item_values_lines for timing and value
This keeps identity, classification, timing and value clearly separated.
Key takeaway
Invoice.meta_codesis your authoritative catalogue of invoice status, type and commercial context.Shape it deliberately, preserve meaning via META_TYPE + ATTRIBUTE, and use helpers for slicers — and invoice reporting stays flexible without becoming fragile.