Use an allowed subject code

Error FX-SCH-A-000633 Factur-X

Value of 'ram:SubjectCode' 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:SubjectCode is not empty and does not match a value in its associated code list. This specific check also accepts an empty value.

What the rule means

The subject code classifies the note using a defined code list. Under this rule, a value that is not listed cannot be assigned to a valid category.

Please use an allowed subject code for the note

The value entered in ram:SubjectCode is not included in the code list checked for this field. You can check it against the allowed entries and adjust it.

What to do
  1. Locate the affected ram:SubjectCode in the note.
  2. Check whether its value is included in the code list applicable to this element.
  3. Generate the invoice again and validate it once more.
Technical details

The XPath test accepts an empty code or a value present in the code list identified by 5.

Where the rule applies

The rule applies to ram:SubjectCode within a note in the document header.

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