Invalid referenced-document type

Error FX-SCH-A-001127 Factur-X

Value of 'ram:TypeCode' is not allowed.

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

The value in ram:TypeCode is not included in the value list allowed for this element. This check permits an empty value.

What the rule means

ram:TypeCode identifies the type of the referenced document. A code that is not allowed cannot be classified unambiguously as a supported document type.

Please use an allowed type for the referenced document

The value provided in ram:TypeCode is not allowed for the document type. You can correct the entry using the value list defined for this element; this check accepts an empty value.

What to do
  1. Locate the referenced document within the invoice line.
  2. Check the value of ram:TypeCode against the value list defined for it.
  3. Generate the invoice again and validate it once more.
Technical details

The check accepts an empty value or a value present in the code list for ram:TypeCode.

Where the rule applies

The rule applies to ram:TypeCode in a referenced document at invoice-line level.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument/ram:TypeCode
Test expression (assert/@test)
string-length($codeValue18)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=18]/enumeration[@value=$codeValue18]