Related Values

Purpose

The purpose of Related Value-Features is to show values on some items that are really associated with another item.

Being a pretty abstract statement, let us consider the following example: Assume you have an item in Perfion which happens to be a product. Assume that you have defined a selectable string feature named Color.

3 sample products could look like this:

 

As can be seen all 3 products have a value for the Color-feature.

Now assume that the Color-feature also has a configuration, i.e. it has its own features with values. A view of Color-items could look like this:

 

The purpose of Related Value-features is to make it possible to see feature-values belonging to Color-Items on the Product-Items. That is, you want to see the value of “HEX”-, “RALColorNo”-, “Description”- and maybe even the “MyImage”-features on products. It should look like this:

 

The above indeed shows Related Value-features. The grey background color indeed shows that they indeed are Related Value-features. To be more precise it denotes “self-remotes” as opposed to (normal) remotes accessing another database than the Perfion database itself. There is no distinction made between self-remotes and normal remotes, both are shown in grey. In previous versions of Perfion (i.e. prior 5.1 2022) self-remotes were shown in green and normal remotes in blue.

In previous versions of Perfion (i.e. prior 4.6 2019) the above result was achievable by creating a so-called self-remote, i.e. a remote feature accessing the Perfion Database itself. The Related Values makes the task much less tedious.

Creating a Related Value-feature

Please note that as all feature editing, creating and editing a Related Value-Feature requires Administrative privileges.

In order to create a Related Value-feature go to Features. In the left hand Feature-Tree right click the “Related Values”-node and select “Add new…”. Doing this on the “Related Values”-node makes Perfion show a special create feature-dialog as shown below:

 

When defining a related value feature you must provide 3 “things”:

  • Name: As any other feature, the Related Value-feature must have a unique name.

  • Base Feature: Here you select the feature which bears the configuration. In our previous example it would be the Color-feature. In the dropdown-menu for Base Feature you can only select features that have a configuration and are not multi-value.

  • Value Feature: Here you can select among all features in the Base Features configuration. The feature must be of Data Type Date, String, Number, Link, String, Text or Image and may not be a remote feature it self (A related value is considered a (self-) remote in this respect. Multi value-features are available here, but only those of type string. The values of such feature are a single string in which all the multivalues are combined with a semicolon.

  • Clicking “Create”-button will create the feature.

NOTE: “Related Value”-features are all grouped under the “Related Value”-feature regardless of their type (String, Number etc.)

Editing a Related Value-feature

The newly created feature will have the same Captions, Units, Help Text etc. and be in the same Groups as the Value-feature, since this information is copied from the Value-feature to the Related Value-feature upon creation of the latter.

You can edit the Related Value-feature just as any other feature. This will bring up the “normal” Feature Definition-editor and will allow you to edit Captions, Units, Views etc. if needed.  

The lookupRALColorNo-feature just created looks like this when edited:

 

NOTE: It is possible to edit both Base and Value-feature as can be seen.

Using a Related Value-Feature

A Related Value-feature works in most respects as a remote-feature, i.e.:

  • It can be added to a configuration

  • It can be queried in the Perfion API, either by selecting it explicitly or by using the **-designator.

In the figure below, 4 Related Value-features have been created and added to the configuration of “Product”:

 

The configuration gives the desired result: