At most one ram:RoleCode in ram:PayerTradeParty

Error FX-SCH-A-000929 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:PayerTradeParty. The element may occur no more than once.

What the rule means

The payer’s role code is provided no more than once in this XML context.

Please include the payer’s role code no more than once

ram:RoleCode appears more than once in ram:PayerTradeParty. You can adjust the XML so that the element occurs no more than once.

What to do
  1. Find ram:PayerTradeParty in the invoice.
  2. Check whether it contains more than one ram:RoleCode element.
  3. Remove any extra ram:RoleCode elements, or omit the element if no role code is provided.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:PayerTradeParty>
  <ram:RoleCode/>
  <ram:RoleCode/>
</ram:PayerTradeParty>
✓ Correct
<ram:PayerTradeParty>
  <ram:RoleCode/>
</ram:PayerTradeParty>
Technical details

The rule counts direct ram:RoleCode elements under ram:PayerTradeParty and permits zero or one occurrence.

Where the rule applies

The rule applies to the role code within document-level ram:PayerTradeParty.

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