Referenced document type code is not allowed

Error FX-SCH-A-000863 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 of ram:TypeCode is not empty and does not match an entry in the associated code list.

What the rule means

ram:TypeCode identifies the type of the referenced document. Under this rule, a value absent from the list is not recognized as an allowed type code.

Please use an allowed type code for the referenced document

The value of ram:TypeCode for the referenced document is not included in the allowed code list. Using an allowed value makes it possible to validate the invoice again.

What to do
  1. Locate ram:TypeCode for the referenced document.
  2. Check its value against the allowed code list.
  3. Generate the invoice again and validate it again.
Technical details

The test accepts an empty value or a value included in the code list identified by 51.

Where the rule applies

The rule applies to ram:TypeCode in the referenced document within the settlement at document level.

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