Provide exactly one document reference for the invoice line

Error FX-SCH-A-000266 Factur-X

Element 'ram:AssociatedDocumentLineDocument' must occur exactly 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

ram:AssociatedDocumentLineDocument does not occur exactly once in the invoice line. The element is either missing or occurs more than once.

What the rule means

The associated document is part of the structure of each invoice line and must occur there exactly once.

Please provide exactly one document reference for the invoice line

The invoice line is missing its associated ram:AssociatedDocumentLineDocument, or it contains the element more than once. Exactly one is required.

What to do
  1. Locate the affected ram:IncludedSupplyChainTradeLineItem.
  2. Ensure that it contains ram:AssociatedDocumentLineDocument exactly once.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:IncludedSupplyChainTradeLineItem/>
✓ Correct
<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument/>
</ram:IncludedSupplyChainTradeLineItem>
Technical details

In the context of ram:IncludedSupplyChainTradeLineItem, the expression checks whether exactly one ram:AssociatedDocumentLineDocument element occurs.

Where the rule applies

Applies to ram:AssociatedDocumentLineDocument within each ram:IncludedSupplyChainTradeLineItem.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem
Test expression (assert/@test)
count(ram:AssociatedDocumentLineDocument)=1