Skip to content

State and Country/Territory Picklists

State and Country/Territory Picklists is a Salesforce feature that replaces the free-text state and country fields of the standard address fields with picklists. Once the feature is enabled, Salesforce maintains an additional code field next to every state and country field – BillingCountryCode next to BillingCountry, ShippingStateCode next to ShippingState, and so on. For details, see State and Country/Territory Picklists in the Salesforce Help.

Several JustOn features read these code fields. This page lists which functionality depends on them, and what happens if the picklists are not enabled.

Code Value Origin

The code fields exist on the account only if the picklists are enabled and configured. On invoice creation, JustOn Billing & Invoice Management copies them from the account to the invoice, provided that the address on the invoice is still empty.

Account Field Invoice Field
Billing Country Code Billing Country Code
Billing State Code Billing State Code
Shipping Country Code Shipping Country Code
Shipping State Code Shipping State Code

Note

Without the picklists, the source fields do not exist, and JustOn skips the copy silently. The code fields on the invoice stay empty, and there is no error message. The problem surfaces much later – as a failed e-invoice validation, a missing QR code or an incorrectly determined tax rate.

Picklist-Dependent Features

The following features read the country or state code of the invoice. Without the picklists, they fail.

Functionality Effect Without the Picklists
Swiss QR code invoices The QR code is not produced. Billing Country Code on the invoice is mandatory input for the structured QR data.
E-invoices The e-invoice XML file is not produced. The buyer country code (BT-55) is mandatory in EN 16931, and the deliver-to country code (BT-80) is mandatory as soon as the e-invoice carries a deliver-to address.
E-invoice status check The Invoice Status component lists Billing Country Code among the missing fields and blocks the creation of the e-invoice.
Invoice region and reverse charge The formula field ON_Region on the Account object evaluates BillingCountryCode directly. Without the picklists, the field cannot be created, and the JustOn Configurator packages that deploy it fail to install.

Because the invoice region feeds the standard tax rules, the reverse charge detection and the VAT category code of e-invoices, it is the single most far-reaching of these dependencies.

Features with Fallback

The following features read the code field first and fall back to the plain country or state name if the code is empty. They work without the picklists – but with different values, so the configuration must be maintained consistently.

Functionality With the Picklists Without the Picklists
Tax rules Invoice Country and Invoice State of the tax rule must specify the code The tax rule must specify the country or state name
AvaTax integration The ship-to address is transmitted using ISO codes AvaTax receives plain names, which can cause address resolution errors

Business Entity Country Code

Country Code and State Code on the business entity are ordinary text fields that you maintain by hand. Enabling the picklists neither creates nor fills them.

Consequently, the features that read the seller side work independently of the picklists – among them the seller country code (BT-40) of an e-invoice, the business scope of a Peppol transmission, and the locale of the payment page. If these produce wrong results, check the business entity, not the picklists.

JustOn does not validate the entered value. Use the ALPHA-2 notation as specified in ISO 3166-1, for which the picklists are a convenient reference.

Info

Creating an e-invoice therefore depends on both sources: the buyer country code comes from the invoice and requires the picklists, the seller country code comes from the business entity and requires manual data maintenance. The same error message can have either cause.

Country Code Without Account Address

The field Legal Country Code on the subscription overwrites Billing Country Code on the invoice during the invoice run. This is the only way to set the billing country code of an invoice independently of the account – and it works without the picklists.

Effects of Enabling/Disabling Picklists Later

The formula field ON_Region recalculates whenever it is read. Switching the picklists on or off therefore changes the region that an account produces, and with it the tax rule that matches.

Invoices that already exist keep the region stored in their Region field. Any invoice created after the switch, however, may be taxed differently, even for the same account. Review the region formula and the tax rules together with the switch, and verify the result on a test invoice before returning to productive invoice runs.