At most one subject code per note

Error FX-SCH-A-000161 Factur-X

Element 'ram:SubjectCode' may occur at maximum 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

An ram:IncludedNote contains more than one ram:SubjectCode element. A note may contain at most one subject code.

What the rule means

This limit ensures that no more than one subject code is assigned to a note.

Please use no more than one subject code per note

A note contains more than one subject code. You can resolve this by limiting the number of ram:SubjectCode elements to one.

What to do
  1. Find the affected ram:IncludedNote.
  2. Remove any extra ram:SubjectCode elements from it.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:IncludedNote>
  <ram:SubjectCode/>
  <ram:SubjectCode/>
</ram:IncludedNote>
✓ Correct
<ram:IncludedNote>
  <ram:SubjectCode/>
</ram:IncludedNote>
Technical details

Within ram:IncludedNote, the number of direct ram:SubjectCode elements is checked to be no greater than one.

Where the rule applies

The rule applies to each ram:IncludedNote note in the document.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:IncludedNote
Test expression (assert/@test)
count(ram:SubjectCode)<=1