At most one country subdivision in the manufacturer address

Error FX-SCH-A-001163 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 ram:PostalTradeAddress.

What the rule means

The manufacturer address may contain at most one country subdivision. Multiple entries of this kind exceed the occurrence limit for this element.

Please provide no more than one country subdivision in the manufacturer address

ram:CountrySubDivisionName is entered more than once in the manufacturer’s postal address. It may occur at most once.

What to do
  1. Locate the manufacturer’s ram:PostalTradeAddress.
  2. Make sure ram:CountrySubDivisionName occurs no more than once in it.
  3. Remove any repeated entry if necessary.
  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 test limits the number of direct ram:CountrySubDivisionName elements in ram:PostalTradeAddress to zero or one.

Where the rule applies

The rule applies to ram:CountrySubDivisionName in the postal address of the manufacturer of a product on an invoice line.

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