What is a virtual attribute?

6
I see the term 'Virtual Attribute' going around a lot and I am not quite sure what these are used for and how I create one. Can someone explain how these work?
asked
3 answers
15

Virtual are attributes which are based on a micro flow. These attributes are not stored in the database but every time the objects is retrieved or changed the virtual attributes are recalculated again.

Information about attributes can be found here.

Explanation how to deal with calculated data can be found here.

Note:

There are multiple drawbacks for virtual attributes, I recommend to use them as little as possible!!

  • Performance, because each time objects are retrieved each attribute for each object is recalculated. This costs a lot of processing power.
  • You cannot sort on a virual attribute, Sorting is done by the database engine. Because virtual attributes are not stored in the database you cannot sort on them.
answered
3

These are attributes that calculate their value by use of an micro flow that you can design yourself. They are not stored in the database, but are recalculated everytime you retrieve the value. Please note that you can't use Xpath queries on these attributes and therefore you can't search/sort on their values in a data grid.

answered
0

These attributes can be used to display values that can change at any time.

Examples:

  1. A person's age
  2. The number of objects with a certain status (e.g. the number of 'In progress' orders)
answered