Allowed ReferenceTypeCode value

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

If ram:ReferenceTypeCode has a value, it must be listed in the value list used by this rule. A value not listed there is not allowed; an empty value also satisfies this check.

What the rule means

The code identifies the type of reference. The value list ensures that this information is represented consistently using defined values.

Please use an allowed value for ReferenceTypeCode

The specified reference type code is not included in the value list used by this rule. Use a value listed there or leave the element value empty.

What to do
  1. Check the value of ram:ReferenceTypeCode.
  2. Replace a value not listed in the value list used by this rule with a listed value, or leave the element value empty.
  3. Generate the invoice again and validate it.
What it looks like
✓ Correct
<ram:ReferenceTypeCode/>
Technical details

The test accepts an empty element value or a value present in enumeration 20 of the referenced code list.

Where the rule applies

The rule checks the value of ram:ReferenceTypeCode on the referenced document on the agreement level of 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]