Use an allowed reference type code

Error FX-SCH-A-001024 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 value list used by this rule. An empty value is also accepted by this check.

What the rule means

The reference type code identifies the type of reference for the additional referenced document. This rule cannot confirm an unlisted value as an allowed code.

Please use an allowed reference type code

The value of ram:ReferenceTypeCode is not included in the value list used for it. Compare the entered value with that list.

What to do
  1. Find the affected ram:ReferenceTypeCode and read its value.
  2. Compare the value with the reference type value list.
  3. Generate the invoice again and validate it.
Technical details

The check accepts an empty value or a value listed in FACTUR-X_EXTENDED_codedb.xml under code list ID 20.

Where the rule applies

The rule applies to ram:ReferenceTypeCode of an additional referenced document on an invoice line.

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