Ability to Sort Country Codes in the AddressScreen
This prototype demonstrates the ability to sort or order the list of country codes appearing under the AddressScreen via configuration with the two examples below:
- With Optional attribute <CountryCodeOrdinal> configuration
- Without Optional attribute <CountryCodeOrdinal> configuration
Prerequisites
- AddressScreen business rule should be configured at Prototype Company Level.
- The Address types such as Mailing address, EFT etc should exist to execute the SQL query in order to view the country code order.
New Items
The AddressScreen is configured by adding a new element namely, <CountryCodeOrdinal> with a new display name configured with the TITLE attributes, which can be populated by SQL. This will control the order of the countries to be displayed in the CountryCodeOrdinal dropdown on the AddressScreen. The countries that are included in the SQL will appear in the dropdown. Select any address type to execute the SQL such as "Mailing address" or "EFT" etc and execute the SQL query to view the country code order.
Existing Items
Rule Name: AddressScreen at Prototype Company Level
Configuration Details
A. Configuration with new element <CountryCodeOrdinal> in "Address Screen" Business rule at Prototype Company Level.
- A new element is added to the AddressScreen namely <CountryCodeOrdinal> along with "TITLE" AND "TYPE"
- Add title name and the query type = SQL
- <CountryCodeOrdinal TITLE="Client Country" TYPE="SQL">SELECT CountryCode, CountryLongName FROM AsCountry ORDER BY CASE CountryCode WHEN 'US' THEN 1 WHEN 'CA' THEN 2 ELSE 3 END, CountryLongName</CountryCodeOrdinal>
- The following are the examples for the AddressTypes "EFT" & "Mailing" wherein the list gets displayed as configured in order under countrycodeordinal tag
For Address Type EFT:
<AddressType VALUE="01" NAME="EFT"><CountryCode>US</CountryCode><CountryCode>CA</CountryCode><CountryCode>GB</CountryCode><CountryCode>ES</CountryCode></AddressType>
For Address Type Mailing:
<AddressType VALUE="05" NAME="Mailing"><CountryCode>US</CountryCode><CountryCode>CA</CountryCode><CountryCode>GB</CountryCode><CountryCode>ES</CountryCode></AddressType>
B. Configuration without adding optional attribute "TITLE" & TYPE" in tag <CountryCodeOrdinal> and the list is in alphabetical order by code value <CountryCodeOrdinal/>