Provide no more than one sales agent role code

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

The ram:SalesAgentTradeParty element contains more than one ram:RoleCode. This context allows no more than one role code.

What the rule means

The limit ensures that multiple role codes are not specified for the sales agent in this location.

Please provide no more than one role code for the sales agent

Several ram:RoleCode elements are present in the sales agent section. This element may appear there no more than once.

What to do
  1. Find ram:SalesAgentTradeParty in the agreement.
  2. Remove any extra 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:SalesAgentTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
  <ram:RoleCode>B</ram:RoleCode>
</ram:SalesAgentTradeParty>
✓ Correct
<ram:SalesAgentTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
</ram:SalesAgentTradeParty>
Technical details

The rule counts the direct ram:RoleCode elements under ram:SalesAgentTradeParty and allows zero or one.

Where the rule applies

The rule applies to ram:RoleCode within ram:SalesAgentTradeParty in the agreement.

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