At most one RoleCode

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

RoleCode occurs more than once in UltimateShipToTradeParty. This element may occur no more than once there.

What the rule means

The ultimate ship-to party details may contain at most one role code, so that the role is not stated more than once.

Please provide no more than one role code for the ultimate ship-to party

ram:RoleCode is stated more than once for the ultimate ship-to party. You can resolve this by having this element occur no more than once there.

What to do
  1. Find ram:RoleCode within ram:UltimateShipToTradeParty.
  2. Remove the extra ram:RoleCode elements so that no more than one remains.
  3. Generate the invoice again and check it once more.
What it looks like
✗ Triggers the message
<ram:UltimateShipToTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
  <ram:RoleCode>B</ram:RoleCode>
</ram:UltimateShipToTradeParty>
✓ Correct
<ram:UltimateShipToTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
</ram:UltimateShipToTradeParty>
Technical details

The check counts the direct ram:RoleCode elements within UltimateShipToTradeParty and requires the count to be no greater than one.

Where the rule applies

The rule applies to the ultimate ship-to party details in UltimateShipToTradeParty at delivery level.

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