Working with categorised user-defined enumerations

As well as creating standard user-defined enumerations, you can create 'categorised' user-defined enumerations. These are user-defined enumerations that are associated with each other. When you create user-defined fields based on categorised user-defined enumerations, the value that you select in one field determines the values that are available in the other. For example, you might want to create a series of user-defined enumerations that define the location of a project in terms of country, county and town.

To do this, you could set up the following three user-defined enumerations:

User-defined enumeration name User-defined enumeration values
Country England; Scotland; Wales
County Cheshire; Derbyshire; Shropshire; Staffordshire; Aberdeenshire; Angus; Argyll; Banffshire; Anglesey; Caernarfonshire; Denbighshire; Flintshire
Town Chester; Macclesfield; Nantwich; Warrington; Bakewell; Buxton; Derby; Matlock; Ludlow; Shrewsbury; Oswestry; Wem; Cannock; Lichfield; Stafford; Tamworth; Fraserburgh; Peterhead; Stonehaven; Turriff; Arbroath; Brechin; Carnoustie; Montrose; Dunoon; Helensburgh; Inveraray; Tobermory; Banff; Buckie; Cullen; Macduff; Beaumaris; Holyhead; Menai Bridge; Niwbwch; Caernarfon; Bangor; Conwy; Llandudno; Denbigh; Llangollen; Rhuddlan; St Asaph; Connah's Quay; Flint; Holywell; Queensferry

If 'Country', 'County' and 'Town' were set up as standard user-defined enumerations, then used in three project-level user-defined fields and displayed one after another, they would appear as follows when you created or edited a project:

Three user-defined fields associated with standard user-defined enumerations

However, if 'Country', 'County' and 'Town' were set up as standard user-defined enumerations, they would not be associated with each other in any way, so you could select inappropriate values in the three fields. For example, you could select 'England' in the Country field, 'Argyll' in the County field and 'Llandudno' in the Town field - which is obviously undesirable:

Inappropriate selections made in the three user-defined fields

To avoid this, you should set up 'County' and 'Town' as categorised user-defined enumerations. You can set them up in such a way that your 'Country' selection determines the 'County' values that are available, and your 'County' selection determines the 'Town' values that are available. In this example, if you selected 'England' in the Country field, the only counties available in the County field would be 'Cheshire', 'Derbyshire', 'Shropshire' and 'Staffordshire'; if you then selected 'Shropshire' in the County field, the only towns available in the Town field would be 'Ludlow', 'Shrewsbury', 'Oswestry' and 'Wem'.

If 'Country', 'County' and 'Town' were set up as categorised user-defined enumerations, then used in three project-level user-defined fields and displayed one after another, they would appear as follows when you created or edited a project:

Three user-defined fields associated with categorised user-defined enumerations

The Change buttons to the right of the County and Town fields indicate that the fields correspond to categorised user-defined enumerations. Rather than changing the selection in these fields by selecting from a drop-down list, you click Change and select the new value from a popup.

Setting up categorised user-defined enumerations

The following instructions show you how to set up a series of categorised user-defined enumerations to represent country, county and town, as in the above example, and how to set up a series of project-level user-defined fields that correspond to the user-defined enumerations:

  1. Create a standard user-defined enumeration with a name of 'Country'. This will be the top-level user-defined enumeration. Enter the following enumeration values into it:
    • England.
    • Scotland.
    • Wales.
  2. Create a categorised user-defined enumeration with a name of 'County'. This will be the middle-level user-defined enumeration. In the properties of the user-defined enumeration, select 'Country' in the Category UDE field and enter the following enumeration values for each 'Country' category value:
    Country category valueUser-defined enumeration values
    EnglandCheshire; Derbyshire; Shropshire; Staffordshire
    ScotlandAberdeenshire; Angus; Argyll; Banffshire
    WalesAnglesey; Caernarfonshire; Denbighshire; Flintshire
  3. Create a categorised user-defined enumeration with a name of 'Town'. This will be the bottom-level user-defined enumeration. In the properties of the user-defined enumeration, select 'County' in the Category UDE field and enter the following enumeration values for each 'County' category value:
    County category valueUser-defined enumeration values
    CheshireChester; Macclesfield; Nantwich; Warrington
    DerbyshireBakewell; Buxton; Derby; Matlock
    ShropshireLudlow; Shrewsbury; Oswestry; Wem
    StaffordshireCannock; Lichfield; Stafford; Tamworth
    AberdeenshireFraserburgh; Peterhead; Stonehaven; Turriff
    AngusArbroath; Brechin; Carnoustie; Montrose
    ArgyllDunoon; Helensburgh; Inveraray; Tobermory
    BanffshireBanff; Buckie; Cullen; Macduff
    AngleseyBeaumaris; Holyhead; Menai Bridge; Niwbwch
    CaernarfonshireCaernarfon; Bangor; Conwy; Llandudno
    DenbighshireDenbigh; Llangollen; Rhuddlan; St Asaph
    FlintshireConnah's Quay; Flint; Holywell; Queensferry
  4. Create a project-level user-defined field called 'Country'. In the properties of this field:
    • Select 'Enumeration' in the Field type field.
    • Select 'Country' in the Enum definition field to link it to the 'Country' user-defined enumeration that you created in step 1 above.
    • Do not select anything in the Category UDF field.
  5. Create a project-level user defined field called 'County'. In the properties of the field:
    • Select 'Enumeration' in the Field type field.
    • Select 'County' in the Enum definition field to link it to the 'County' user-defined enumeration that you created in step 2 above.
    • Select 'Country' in the Category UDF field to specify that the values that are offered to you in the County field should depend on the value you select in the Country field. For example, if you select 'Wales' in the Country field, you will be offered the choice between 'Anglesey', 'Caernarfonshire', 'Denbighshire' and 'Flintshire' in the County field.
  6. Create a project-level user defined field called 'Town'. In the properties of the field:
    • Select 'Enumeration' in the Field type field.
    • Select 'Town' in the Enum definition field to link it to the 'Town' user-defined enumeration that you created in step 3 above.
    • Select 'County' in the Category UDF field to specify that the values that are offered to you in the Town field should depend on the value you select in the County field. For example, if you select 'Anglesey' in the County field, you will be offered the choice between 'Beaumaris', 'Holyhead', 'Menai Bridge' and 'Niwbwch' in the Town field.

You must ensure that users who are to edit these fields have access rights to view and edit every one of the series of user-defined fields, and that every one of the series of fields is visible to users.

The above example shows only one possible use of categorised user-defined enumerations; you can use categorised user-defined enumerations to represent any multi-level information you like, and they can have any number of levels. For example, you could use them to represent:

  • Sector and Sub-sector (two levels).
  • Company, Department and Sub-department (three levels).

Categorised user-defined enumerations can be used with project-level, programme-level and user-level user-defined fields.

Viewing relationships between categorised user-defined enumerations

Once you have set up a series of categorised user-defined enumerations, you can view a hierarchical display that shows how they are related to each other.

To do this:

  1. On the User Defined Enumerations page, click Show Hierarchy to the left of a user-defined enumeration. This icon only appears to the left of categorised enumerations - ie those that are related to other enumerations - and to the left of the standard enumeration that acts as the top-level of the hierarchy. The UDE Hierarchy page appears, depicting the hierarchy of which the categorised enumeration is a part:

    The UDE Hierarchy page
  2. While viewing this page, you can click the triangle to the left of a level in the hierarchy to expand or contract it; click the name of a user-defined enumeration or field to edit it.
  3. Click Close to close the UDE Hierarchy page.

Once you have set up a series of categorised user-defined enumerations, a Show Hierarchy icon appears to the left of the enumerations on the User Defined Enumerations page - and to the left of the standard enumeration that acts as the top-level of the hierarchy. Click this icon to the left of an enumeration to view a hierarchical display that shows how it is related to other categorised enumerations.

Using a categorised user-defined enumeration as a standard user-defined enumeration

Once you have set up a categorised user-defined enumeration, as well as using it in a user-defined field as a categorised user-defined enumeration - where the values you are offered depend upon the value you select in other field - you can set up a user-defined field that uses it as a standard user-defined enumeration. If you do this, all of the user-defined enumeration values become available for selection in the user-defined field: the values on offer do not depend upon your selection in another field.

In the example above, you could create a user-level user-defined field called 'Town', linked to the 'Town' user-defined enumeration, to provide a drop-down list of all available towns, regardless of country or county, when creating and editing users. To do this, create a user-level user-defined field called 'Town'. In the properties of the field:

  • Select 'Enumeration' in the Field type field.
  • Select 'Town' in the Enum definition field to link it to the 'Town' user-defined enumeration.
  • Do not select anything in the Category UDF field.

Related Topics:

Working with user-defined enumerations

Working with user-defined fields