Allowed document type code

Error FX-SCH-A-000417 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 neither empty nor included in the code list used for document types.

What the rule means

When provided, the document type code must match a value in the associated code list.

Please use an allowed document type code

The value of ram:TypeCode is not included in the associated code list. Use a value listed there or leave the element empty.

What to do
  1. Check the value in ram:TypeCode against the code list for document types.
  2. Use a value included in that list or leave ram:TypeCode empty.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty resolved code value or a value from the enumeration for code list ID 2.

Where the rule applies

The rule checks the value of the ram:TypeCode element in the exchanged document.

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