This example describes a scenario where a construction company wants to use a single
hierarchically ordered list of values for three separate properties referring to the
location of a construction site. They want the hierarchical value list to be based
on actual objects in their vault.
To create the required metadata structure and objects for this kind of scenario,
follow the steps provided below. The names of the structure elements are examples
only, and you can freely name them as you like.
First, open M-Files Admin and create the required metadata
structure elements as instructed below.
Create an object type with the names Area (singular)
and Areas (plural).
Create four property definitions that have the names listed below. All of them
should be of the data type Choose from list
and should show values from the value list Areas, essentially consisting of various Area objects in your vault.
Tip: You can optionally set the following filters for the continent and country properties if you want the
continent property to only show continents and the country property to hide
cities from the list:
Construction site
continent: Class = Continent
Construction site country: Class != City
Create the following three classes:
Continent
Country
City
As the value of the Object type setting for each one,
select Area.
Under the Properties section, add the Belongs to area property for all the three
classes. This way, the property is automatically added to the metadata card
when you are creating these objects later on.
Next, open M-Files Desktop and create a hierarchy of continent,
country, and city objects using the newly created metadata structure
elements.
Create a set of continents:
Click the Create button in the top area and
select Area.
To the Class field, enter Continent.
To the Name or title field, enter
the name of the continent, such as Asia.
Leave empty the value of the Belongs to
area field as this is a top-level object.
The top-level object must contain this property as well because it
defines that it belongs to the same hierarchy as its descendant objects
(in this example, countries and cities).
Click Create once you are done.
Repeat these steps for as many objects of this class as you
require.
Create a set of countries:
Click the Create button in the top area and
select Area.
To the Class field, enter Country.
To the Name or title field, enter
the name of the country, such as India.
To the Belongs to area field, enter
the name of the continent in which this country is located, such as Asia.
Click Create once you are done.
Repeat these steps for as many objects of this class as you
require.
Create a set of cities:
Click the Create button in the top area and
select Area.
To the Class field, enter City.
To the Name or title field, enter
the name of the city, such as Mumbai.
To the Belongs to area field, enter
the name of the country in which this city is located, such as India.
Click Create once you are done.
Repeat these steps for as many objects of this class as you
require.
Finally, open M-Files Admin again and, by following the
instructions in Specifying Hierarchical Properties, set the
property definitions Construction site
continent, Construction site
country, and Construction site
city to use the Belongs to
area hierarchy. The configuration should look similar to the one
presented below.
Hierarchies
Construction site
continent
Hierarchy Name =
Construction site
continent
Target Property =
Construction site
continent
Hierarchy
Property = Belongs to area
Construction site country
Hierarchy Name = Construction site country
Target Property = Construction site country
Hierarchy
Property = Belongs to area
Construction site city
Hierarchy Name = Construction site city
Target Property = Construction site city
Hierarchy
Property = Belongs to area
Click Save and close M-Files Admin once you are done.
Now, when you add the properties Construction site continent, Construction site
country, and Construction site city
to the metadata of an object, they all show the same hierarchical list of areas that you
can use to select the location of the construction site.