Use an allowed reference type

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 in ram:ReferenceTypeCode is neither empty nor included in the code list for this reference type.

What the rule means

ram:ReferenceTypeCode classifies the type of contract reference. A disallowed code can prevent this reference from being clearly classified.

Please use an allowed contract reference type

The contract reference type in ram:ReferenceTypeCode is not in the designated code list. You can correct the entry or leave it empty.

What to do
  1. Find the relevant ram:ReferenceTypeCode under ram:ContractReferencedDocument.
  2. Check whether the entered value belongs to the designated code list, or leave the value empty.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ReferenceTypeCode>INVALID</ram:ReferenceTypeCode>
✓ Correct
<ram:ReferenceTypeCode/>
Technical details

The test passes when the code value is empty or occurs as a value in the enumeration with id=37 in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

The rule applies to ram:ReferenceTypeCode of the contract reference document in the invoice agreement.

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]