Edit supporting user interface files and add New Zealand suburb field

Before you begin

Complete the step Configure the Currency XML file for New Zealand currency before you perform this step.

Procedure

  1. Press Ctrl+Shift+N and enter Address.en, and then double-click Address.en in the search results to open it in the editor.
  2. In the top part of the editor, click the Add icon and then enter the following values:
    • Namesuburb
    • Entity PathAddress.Suburb
  3. Below this top pane, there is a code pane with a Default tab. Click this tab and add a line of code defining a Suburb to the list of formatter address field definitions. If necessary, add a comma to the end of the preceding line:
    :CEDEXBureau = CEDEXBureau,
    :Suburb = suburb
  4. In ContactManager only, this code pane also has a Full tab. Click this tab and make the same addition as you did in the Default tab.
  5. Press Ctrl+N and enter AddressOwnerFieldId, and then double-click AddressOwnerFieldId in the search results to open this class in the editor.
  6. Add the following line of code to the constant declarations for available fields:
    public static final var SUBURB : AddressOwnerFieldId = 
      new AddressOwnerFieldId("Suburb")
  7. Add the Suburb field to the constant representing all PCF address fields:
    public final static var ALL_PCF_FIELDS : Set<AddressOwnerFieldId> =
      { ADDRESSLINE1, ADDRESSLINE2, ADDRESSLINE3, SUBURB, CITY, COUNTY, 
        STATE, POSTALCODE, COUNTRY, ADDRESSLINE1KANJI, ADDRESSLINE2KANJI, 
        CITYKANJI, CEDEX, CEDEXBUREAU }.freeze()
  8. Hide the Suburb field from the default search screens by changing the settings in AddressOwnerFieldId for HIDDEN_FOR_SEARCH and HIDDEN_FOR_PROXIMITY_SEARCH:
    public final static var HIDDEN_FOR_SEARCH : Set<AddressOwnerFieldId> = 
      { ADDRESSLINE1, ADDRESSLINE2, ADDRESSLINE3, SUBURB, COUNTY, ADDRESSLINE1KANJI, 
        ADDRESSLINE2KANJI, CEDEX, CEDEXBUREAU }.freeze()
     
    public final static var HIDDEN_FOR_PROXIMITY_SEARCH : Set<AddressOwnerFieldId> = 
      { ADDRESSLINE1KANJI, ADDRESSLINE2KANJI, SUBURB, CITYKANJI, 
        CEDEX, CEDEXBUREAU }.freeze()

    You can change this setting later if New Zealand is to be the default region.

  9. Press Ctrl+N and enter AddressFormatter, and then double-click AddressFormatter in the search results to open this class in the editor.
  10. Add the following case to switch(_addrCountry) to indicate the suburb, city, and postal code format for a New Zealand address:
    case TC_NZ:
      append(cszBuf, fieldId.SUBURB, delimiter, addr.Suburb)
      append(cszBuf, fieldId.CITY,  " ", addr.City)
      append(cszBuf, fieldId.POSTALCODE, " ", addr.PostalCode)
      break

What to do next

The next step is Add a New Zealand suburb field to the user interface.