Allowed document type code

Error FX-SCH-A-000635 Factur-X

Value of 'ram:TypeCode' 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:TypeCode is not in the code list provided for it. An empty value is also accepted by the test condition.

What the rule means

ram:TypeCode identifies the type of document. A code not in the list cannot be mapped to an allowed document type using the specified values.

Please use an allowed document type code

The value in ram:TypeCode is not in the allowed code list. You can use a listed value or leave the element empty.

What to do
  1. Check the value of ram:TypeCode in ram:ExchangedDocument.
  2. Use an entry from the allowed code list or leave the value empty.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty value or a value present as an enumeration in the code list with identifier 2.

Where the rule applies

The rule applies to ram:TypeCode in ram:ExchangedDocument in the document header.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode
Test expression (assert/@test)
string-length($codeValue2)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=2]/enumeration[@value=$codeValue2]