At most one RoleCode for the payee

Error FX-SCH-A-000908 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

There is more than one ram:RoleCode in ram:PayeeTradeParty. This element may occur no more than once.

What the rule means

The rule limits the payee's role designation to no more than one entry so that the XML structure remains unambiguous.

Please provide no more than one RoleCode for the payee

The payee has multiple ram:RoleCode elements. Remove the extra entries so that no more than one remains.

What to do
  1. Find all ram:RoleCode elements in ram:PayeeTradeParty.
  2. Remove any extra ram:RoleCode elements; the entry is optional.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:PayeeTradeParty>
  <ram:RoleCode/>
  <ram:RoleCode/>
</ram:PayeeTradeParty>
✓ Correct
<ram:PayeeTradeParty>
  <ram:RoleCode/>
</ram:PayeeTradeParty>
Technical details

The check verifies that there is no more than one direct ram:RoleCode element in ram:PayeeTradeParty; the element is optional.

Where the rule applies

The rule applies to the payee details in ram:PayeeTradeParty.

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