Use an allowed country code for the sales agent

Error FX-SCH-A-000745 Factur-X

Value of 'ram:CountryID' is not allowed.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The value of ram:CountryID is not included in the code list used by this rule. The test explicitly allows an empty value.

What the rule means

The country code must be one of the allowed values so that the country in the postal address is identified by a defined code.

Please use an allowed country code for the sales agent

The value in ram:CountryID does not match a country code allowed by this rule. Use a value from the code list provided for countries.

What to do
  1. Locate ram:CountryID in the sales agent’s postal address.
  2. Replace a disallowed value with one from the code list provided for countries.
  3. Generate the invoice again and validate it once more.
Technical details

The rule checks the value of ram:CountryID against the enumeration of code list 10; an empty value also passes this check.

Where the rule applies

The rule applies to the value of ram:CountryID in the sales agent’s postal address under ram:PostalTradeAddress.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:SalesAgentTradeParty/ram:PostalTradeAddress/ram:CountryID
Test expression (assert/@test)
string-length($codeValue10)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=10]/enumeration[@value=$codeValue10]