At most one role code for the invoicee

Error FX-SCH-A-000866 Factur-X

Element 'ram:RoleCode' 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

ram:RoleCode occurs more than once within ram:InvoiceeTradeParty.

What the rule means

The structure allows at most one role code in ram:RoleCode within the invoicee. Multiple occurrences do not meet this requirement.

Please use no more than one role code for the invoicee

ram:RoleCode is entered more than once for the invoicee. Removing the duplicate entries makes it possible to validate the invoice again.

What to do
  1. Locate ram:InvoiceeTradeParty.
  2. Check its ram:RoleCode elements and retain no more than one.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:InvoiceeTradeParty>
  <ram:RoleCode>1</ram:RoleCode>
  <ram:RoleCode>2</ram:RoleCode>
</ram:InvoiceeTradeParty>
✓ Correct
<ram:InvoiceeTradeParty>
  <ram:RoleCode>1</ram:RoleCode>
</ram:InvoiceeTradeParty>
Technical details

The test counts the direct ram:RoleCode elements of ram:InvoiceeTradeParty and requires the count to be no greater than one.

Where the rule applies

The rule applies to ram:RoleCode within ram:InvoiceeTradeParty.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:InvoiceeTradeParty
Test expression (assert/@test)
count(ram:RoleCode)<=1