A constant Set is a very simple thing - a list! Objects can have a constant set as its property, meaning the objects property could be set to any of the items in the list. For example, a product may be Extra Large, Large, Medium, Small or Extra Small. In which case we can set one of the products properties to be a "Constant Set", build the Constant Set and then connect the two together.
The attached Video demonstrates how a Constant Set is created in XPOR Object Modeller and how it is added to an Objct Type as a Property. Finally it demonstrates how the property can be used on an Object Editor form used on the front of a website.
Constant Sets are added and managed in Object Modeller. Log into your Object Modeller and open the Data Ribbon. This presents the list of Constant Sets in your XPOR. Constant Sets are widely used by the system, so you will have a lot of CORE constants sets (shown in Green). You are prevented form editing these.
Your own Constant Sets are shown in Blue - we've already added a few in this installation;
We will now add a New Constants Set, by clicking the Add Constants Set button. This opens a blank constants set;
The fields to be competed are explained below.
Give your Constants Set a Name. This is seen throughout the system as you browse / select the Constants Set for inclusion of Objects.
It is always a good idea to give the Constants Set a Description. For example, as you build your system you may be using a Constants Set as "Size" - e.g. Small / Medium / Large. This might be used in the first instance for an object "Hat". When you add a new object "Shirt" you might also want to use "Size" - and select the Constant Set as a property of Shirt. Then modify the Constant Set to include Extra Large. This means the Constants Set will also show Extra Large for Hats - which might not be appropriate. So write the purpose (and revised purpose) into the Description.
Again, this is a housekeeping function. Keep your Constants sets grouped together.
When the Constants Set is used on an Object Editor field, the values will be displayed in the order selected here. You have three options;
Some field types can accept multiple entries, taken from a single Constants Set - for example, if the property of an object is "Available Size Options" - you might want to pick from this Constants Set and select the currently available Sizes for your Hats.
That has the general aspects of the Constants Set configured.
We can now complete the Constants Set itself. Note, some people refer to this type of list as an Enumerated List - or "enum". We use the phrase "Constants Set" because this is generally what the lists purpose is! But, with a nod to convention, we have titled the list "Enum Values". This list has two principal items to every entry. Firstly the entry has a NAME. This is automatically given a NUMBER - hence the phrase "enumerated list". In Xpor you can access either the Name or the Number.
Clicking the Add Value button opens a form to complete the value and some further descriptive information.
The Value Name is the descriptive text for the list item - in our case the first entry will be "Small" - for our Hat size list.
The first entry in your list is given the Value 0 by default. The 0 value is the default when a new object is made! So, when a New Hat is added to your XPOR, it will be given the numeric size property of 0. You will no doubt want to edit the hat details, including the size, before being satisfied it is correctly described. So, we recommend that the 0 value is set to "Not Selected".
We will set the Value Name we just entered (small) to be Value = 1.
If required, give the Value a Description. This can be useful if you want to record a note that, for example, Small is "50cm to 70 cm".
The Allow Notifications Setting is explained in a separate Help Resource. If this check box is ticked, when an object is set to this Constants Set value (Small) the Notifications Atom will display this property change on the front of the website! This is a really good way of keeping your users up to date with changes / additions etc. to your XPOR objects.
If you select the Custom Order option in "Display Options " explained above, then you set a numeric ascending value here.
If the colour is set, then, in certain functions, you can use this to change the colour of a background to match this setting. For example, if you want to show the size of the Hat as a colour - set the colour here.
Similar to Colour (above) you can have the Constant Set display an Icon, when a Value is selected
For further information and demonstration about using the Constants Set as a property of an object type, please refer to separate Help Resource.