Provide the legal organization address region no more than once

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

In the relevant ram:PostalTradeAddress, ram:CountrySubDivisionName occurs more than once. The element may appear there no more than once.

What the rule means

The address may contain at most one entry for a subdivision of the country. Multiple such elements result in repeated region entries.

Please provide the region in the legal organization address no more than once

The postal address for the legal organization contains the region entry more than once. This element can appear there no more than once.

What to do
  1. Check the postal address in ram:SpecifiedLegalOrganization for repeated ram:CountrySubDivisionName elements.
  2. Leave no more than one ram:CountrySubDivisionName element there.
  3. Regenerate the invoice and validate it again.
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 direct ram:CountrySubDivisionName elements within the postal address of ram:SpecifiedLegalOrganization and allows no more than one.

Where the rule applies

The rule applies to the postal address within ram:SpecifiedLegalOrganization of ram:ProductEndUserTradeParty in the invoice agreement.

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