At most one ram: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

ram:RoleCode occurs more than once in ram:UltimateShipToTradeParty. This element may appear there no more than once.

What the rule means

ram:RoleCode identifies the role of the ultimate delivery recipient. Multiple occurrences would provide more than one role value for the same recipient.

Please provide the ultimate delivery recipient’s role no more than once

The ultimate delivery recipient details contain ram:RoleCode more than once. You can resolve this by making the role entry unambiguous.

What to do
  1. Find ram:RoleCode within ram:UltimateShipToTradeParty.
  2. Remove any extra occurrences so that the element appears no more than once.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:UltimateShipToTradeParty>
  <ram:RoleCode/>
  <ram:RoleCode/>
</ram:UltimateShipToTradeParty>
✓ Correct
<ram:UltimateShipToTradeParty>
  <ram:RoleCode/>
</ram:UltimateShipToTradeParty>
Technical details

The number of direct ram:RoleCode elements within ram:UltimateShipToTradeParty is checked; zero or one is permitted.

Where the rule applies

The rule applies to the ultimate delivery recipient information in ram:UltimateShipToTradeParty in the invoice delivery section.

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