Invalid contract document reference type code

Error FX-SCH-A-000707 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 does not match a value permitted by code list 37. An empty value is permitted by the test condition.

What the rule means

The code identifies the reference type of the contract document. A value that is not permitted cannot be classified using the designated code list.

Please use an allowed reference type code for the contract

The value of ram:ReferenceTypeCode in the contract document is not recognized as an allowed reference type. You can adjust the code and check the invoice again.

What to do
  1. Find ram:ReferenceTypeCode in the referenced contract document.
  2. Check its value against the code list applicable to the reference type.
  3. Generate the invoice again and check it again.
Technical details

The test permits an empty value; otherwise, the value must appear in an enumeration of the code list with id=37.

Where the rule applies

The rule applies to the value of ram:ReferenceTypeCode in the referenced contract document.

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