At most one ram:RoleCode for ProductEndUserTradeParty

Error FX-SCH-A-000710 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 in ram:ProductEndUserTradeParty. This element may appear there no more than once.

What the rule means

The XML structure limits the role designation for ProductEndUserTradeParty to a single entry. Multiple entries do not conform to the defined structure.

Please use no more than one `ram:RoleCode` for `ProductEndUserTradeParty`

The invoice contains multiple ram:RoleCode elements for ProductEndUserTradeParty. You can adjust the XML structure so that no more than one entry is present.

What to do
  1. Locate ram:RoleCode within ram:ProductEndUserTradeParty.
  2. Remove additional ram:RoleCode elements so that no more than one remains.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:ProductEndUserTradeParty>
  <ram:RoleCode>1</ram:RoleCode>
  <ram:RoleCode>2</ram:RoleCode>
</ram:ProductEndUserTradeParty>
✓ Correct
<ram:ProductEndUserTradeParty>
  <ram:RoleCode>1</ram:RoleCode>
</ram:ProductEndUserTradeParty>
Technical details

The check verifies that the number of direct ram:RoleCode elements in the rule context is no greater than one.

Where the rule applies

The rule applies to ram:RoleCode within the header agreement’s ram:ProductEndUserTradeParty element.

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