Use an allowed subject code

Error FX-SCH-A-000490 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 empty or is not listed as an allowed subject code in the code list.

What the rule means

An allowed subject code assigns the note to an intended category. An empty or unlisted code cannot assign a valid category to the note.

Please provide an allowed subject code for the note

The note’s subject code is empty or is not included in the allowed code list. You can check the note’s value against the designated code list.

What to do
  1. Check the value of ram:SubjectCode in the affected ram:IncludedNote.
  2. Make sure the value is not empty and appears in the allowed code list.
  3. Generate the invoice again and validate it.
Technical details

The test checks whether $codeValue4 is empty or occurs as an @value in codedb/cl[@id=4]/enumeration from the externally referenced code list.

Where the rule applies

This rule applies to ram:SubjectCode in an ram:IncludedNote note within rsm:ExchangedDocument.

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