Allowed value for ram:SubjectCode

Error FX-SCH-A-001014 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 non-empty value of ram:SubjectCode is not included in the code list specified for this code.

What the rule means

If provided, the subject code must conform to the specified code list. This check permits an empty value.

Please use an allowed subject code

The value in ram:SubjectCode is not listed as an allowed subject code. If you provide a value, it must belong to the specified code list.

What to do
  1. Check the value in ram:SubjectCode.
  2. Compare the non-empty value with the values allowed for this subject code.
  3. Regenerate the invoice and check it again.
Technical details

The test permits an empty value or requires the value to be listed in FACTUR-X_EXTENDED_codedb.xml in the code list with identifier 5.

Where the rule applies

The rule applies to ram:SubjectCode within the note on a document associated with an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:AssociatedDocumentLineDocument/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]