Exactly one ram:TypeCode per ram:AdditionalReferencedDocument

Error FX-SCH-A-001016 Factur-X

Element 'ram:TypeCode' 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:TypeCode is missing from ram:AdditionalReferencedDocument or occurs more than once. The rule requires exactly one occurrence.

What the rule means

ram:TypeCode specifies the type of the additional document reference. Exactly one element ensures that the reference has a single type designation.

Please include one `ram:TypeCode` in each `ram:AdditionalReferencedDocument`

The additional document reference for the invoice line is missing ram:TypeCode or contains it more than once. Exactly one element is expected per ram:AdditionalReferencedDocument.

What to do
  1. Make sure there is exactly one ram:TypeCode in ram:AdditionalReferencedDocument.
  2. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:AdditionalReferencedDocument/>
✓ Correct
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>TYPE-1</ram:TypeCode>
</ram:AdditionalReferencedDocument>
Technical details

The test requires the number of ram:TypeCode elements in the current ram:AdditionalReferencedDocument to be exactly one.

Where the rule applies

The rule applies within the additional document reference of an invoice line agreement.

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