Provide at most one subdivision in the sales agent’s address

Error FX-SCH-A-000744 Factur-X

Element 'ram:CountrySubDivisionName' 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:CountrySubDivisionName occurs more than once in the sales agent’s ram:PostalTradeAddress.

What the rule means

ram:CountrySubDivisionName identifies a subdivision within a country. The rule limits this information to at most one element.

Please provide the subdivision in the sales agent’s address no more than once

The sales agent’s postal address contains ram:CountrySubDivisionName more than once. You can resolve this by including the element no more than once.

What to do
  1. Locate ram:PostalTradeAddress for the sales agent.
  2. Check the ram:CountrySubDivisionName elements it contains.
  3. Keep no more than one ram:CountrySubDivisionName element.
  4. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Region A</ram:CountrySubDivisionName>
  <ram:CountrySubDivisionName>Region B</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Region A</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
Technical details

The check counts the ram:CountrySubDivisionName elements directly contained in ram:PostalTradeAddress and requires the count to be no greater than one.

Where the rule applies

In the sales agent’s postal address.

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