Allowed subject code

Error FX-SCH-A-000162 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 neither empty nor included in the code list used by this rule.

What the rule means

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

Please use an allowed value for `ram:SubjectCode`

The value provided for ram:SubjectCode 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:SubjectCode against the code list for subject codes.
  2. Use a value included in that list or leave ram:SubjectCode empty.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty resolved code value or a value present in the enumeration for code list ID 4.

Where the rule applies

The rule checks the value of the ram:SubjectCode element within a note.

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