Invalid reference type code

Error FX-SCH-A-000639 Factur-X

Value of 'ram:ReferenceTypeCode' 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:ReferenceTypeCode is not included in the code list for this reference type. This check does not report an empty value as an error.

What the rule means

The reference type code assigns the reference to an allowed category. A code not in the list cannot be classified according to the code list specified for this context.

Please use an allowed reference type code for the document of type `130`

The value in ram:ReferenceTypeCode is not allowed for this additional referenced document. You can resolve the issue by using a code listed for this context.

What to do
  1. Locate the additional referenced document with ram:TypeCode 130.
  2. Check the value in ram:ReferenceTypeCode against the applicable code list.
  3. Enter a value listed there.
  4. Regenerate the invoice and validate it again.
Technical details

The assertion checks the value against entries in the code list identified by 20. An empty value also satisfies the condition.

Where the rule applies

The rule applies to ram:ReferenceTypeCode in an additional referenced document of type 130 within the document-level agreement.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:AdditionalReferencedDocument[ram:TypeCode="130"]/ram:ReferenceTypeCode
Test expression (assert/@test)
string-length($codeValue20)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=20]/enumeration[@value=$codeValue20]