How to configure additional fields
Product line
Standard
|Expert
Operating mode
Cloud Suite
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
The list of existing fields in Vertec is specified by the model and cannot be changed. However, additional fields are available if you want to add additional information to data (e.g. order probability on project).
Additional fields are managed under Settings > Customizing > Additional fields. Each additional field is based on an additional field class. To create an additional field, click on Additional field
in the New menu or right-click on the folder.
Name |
You can access the additional field via this name. See the section Accessing additional fields below. The name must not contain umlauts or start with a number, otherwise the authorization system may fail. Due to a change in version 6.5.0.21, it is no longer permitted to use names for additional fields that match a built-in Python method. This concerns the following expressions:
Additional fields that have such a name are shown as invalidand must be resolved to ensure operation. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description |
Here you can specify the description under which the additional field should appear on the interface. If you do not indicate anything here, the name is shown on the interface. The description is a MLString field, i.e. it is language specific. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Field type, selection type, expression
|
Additional fields can contain standardized values with relevant selection options and input controls. In addition to the field type, you can specify a selection type and an optional expression. The following table describes the available field types with matching selection types (& expressions).
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Order |
Here you can specify the order in which the additional fields should appear on the interface. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Classes |
Specifies where and for which data type the additional field should appear. Select the appropriate type from the dialog by clicking on the three dots. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Visibility |
Additional fields that are used internally for calculations can be hidden on the interface. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Condition |
Visibility can be controlled by an OCL expression. The result of this OCL expression must be a True/False (Boolean). If the result is true, the additional field is shown. |
The additional fields appear in the individual view of the relevant entries on the Further information page:
In addition, you can place them in a different location via customizing.
Starting with Vertec 6.5.0.15, the strings in selection type additional fields are translated if the additional field definition (AdditionalFieldClass) has an entry ID.
zusatzfeldint(<name>)
cmbZusatzfeld
rndZusatzfeld
If you have defined selection type additional fields and want to translate them, define an entry ID on the relevant additional field definition. You can find out how to do this in the article Languages/Terms ??? in the section Translations from version 6.4.0.9 .
You can also show additional field classes in lists, use them in scripts and reports, or filter them in an expression folder by accessing them via OCL. Querying via SQL folder is also possible.
It is important to note that the additional fields on already existing Vertec objects are not created until they are accessed accordingly. Before they are not present in the database, which is, however, essential with access via SQL.
When a new object is created, all associated additional fields are created.
For already existing objects, the additional fields are created in the following operations:
projekt.jahr = 2022
(Example: integer additional field jahr
on project). xxxIt can also simply according to initialized shall be: projekt.jahr = 0
myyear = projekt.jahr
) does not create the field, but read access via OCL does: myyear = projekt.evalocl("zusatzfeldint('jahr')")
zusatzfeldasstring(...)
for example, does not work, since this is a read-only access; zusatzfeldint(...)
, on the other hand, creates the field, because this expression can also be used to write. (Note: This restriction only applies to list settings. For read access via OCL in scripts, as described in point 3, this does not apply. There the field is also created for read-only access)The reason for the somewhat complex behavior of variants 3 and 4 is the optimization, which returns the default value for a non-existent additional field, since a write access should only be prevented due to a display, but no error message should appear.
The field is only accessible via SQL (e.g. via SQL folder) after it has been created. Therefore, the additional fields on classes, for which objects already exist, should always be created directly.
After creating an additional field, you can run a script , which creates the field on all already existing objects, such as:
projekte = vtcapp.evalocl("projekt")
for projekt in projekte:
projekt.jahr = 0
vtcapp.updatedatabase()
You can find out how the different additional field types are initialized in the Python section below.
The various additional field classes can be accessed via OCL as follows:
Additional field type | Operator | Default return value (if nothing has been explicitly set yet) |
---|---|---|
String | zusatzfeld |
Empty string |
True, False | zusatzfeldbool |
Wrong |
Integer number | zusatzfeldint |
0 |
Minutes | zusatzfeldint |
0 |
Fixed-point number | zusatzfeldcurr |
0.00 |
Date | zusatzfelddate |
NULL |
Image | zusatzfeldblob |
NULL |
Object | zusatzfeldobj (see tips below) |
NULL |
Selection | zusatzfeldint (returns the position of the selection)zusatzfeldasstring (returns the selection text) |
0 First value of the list |
Text | zusatzfeld |
Empty string |
ANSI text (legacy) | zusatzfeldblob |
NULL |
Example: All addresses identified as ABC addresses (True,False additional field “ABC address” on address):
adresseintrag->select(zusatzfeldbool('ABC-Adresse'))
In Python you can access the additional fields very easily via the additional field name, e.g. projekt.jahr
.
Read-only access ( myyear = projekt.jahr
) does not create the field (see section When are additional fields created above) whereas write access does ( projekt.jahr = 2022
). If you want to create the field without setting a value, it can be initialized as follows:
Additional field type | Initialization |
---|---|
String | = "" (empty string) |
True, False | = 0 (False) |
Integer | = 0 |
Minutes | = 0 |
Fixed-point number | = 0 |
Date | = None |
ANSI text | = None |
Image | = None |
Object | = None |
Selection | = 0 |
Text | = None |
The various additional fields can be accessed via SQL as follows:
Additional field type | SQL expression (database field) | Where expression |
---|---|---|
String |
Wert | Wert like "Aha%"” |
True, False |
WertBoolean |
|
Integer number |
WertInteger | WertInteger >= 1000 |
Minutes |
WertInteger | WertInteger >= 1000 |
Fixed-point number |
WertCurrency | WertCurrency = 1350 |
Date |
WertDatum | WertDatum = "15.03.2017" |
ANSI Text |
WertBlob | WertBlob containing 'Newsletter’ (Firebird)WertBlob like “%Newsletter%” (MS SQL) |
Image |
WertBlob | WertBlob <> ““ (for: assigned to an image) |
Object |
WertObject |
|
Selection |
WertInteger |
|
Text | WertText | WertText like "%Newsletter%" |
For a detailed description and examples, see SQL expressions for SQL folders.
Additional fields can also be placed in lists and pages by means of customizing. The following matrix applies to the selection of the control:
Field type | Selection type | Control | Example ??? THESE MUST BE CHECKED , NOT SURE WHERE EN OR DE NEEDED |
---|---|---|---|
String | Address | AddressReferenceBox |
<AddressReferenceBox Label="Adresse" ValueExpression="zusatzfeldobj('ZeichenAdresse')" /> |
String | File | PathBox |
<PathBox Label="File" ValueExpression="zusatzfeld('File')" SelectType="FileOpen" /> To open the file directly, you must add a navigation button: <PathBox Label=”File” ValueExpression=”additional field('File’)” ShowNavLinkButton=”True” SelectType=”FileOpen” /> |
String | Path | PathBox |
<PathBox Label=”Path” ValueExpression=”additional field('path’)” SelectType=”Folder” /> To be able to open the path directly, an additional Navigation button shall be inserted. <PathBox Label="Pfad" ValueExpression="zusatzfeld('Pfad')" ShowNavLinkButton="True" SelectType="Folder" /> |
String | Textbox |
<TextBox Label=”Zeichen” ValueExpression=”zusatzfeld('Zeichen’)” /> |
|
True, False | Checkbox |
<CheckBox Label="True, False" ValueExpression="zusatzfeldbool('WahrFalsch')" /> |
|
Integer number | Textbox |
<TextBox Label="Integer number" ValueExpression="zusatzfeldint('Ganzzahl')" /> |
|
Minutes | Textbox |
<TextBox Label=”Minutes” ValueExpression=”zusatzfeldint('Minutes’)” Converter=”Minutes” /> |
|
Fixed-point number | Textbox |
<TextBox Label=”Fixed point number” ValueExpression=”zusatzfeldcurr('fixed point number’)” /> |
|
Date | DatePicker |
<DatePicker Label=”Date” ValueExpression=”zusatzfelddate('Date’)” /> |
|
ANSI Text | TextArea |
<TextArea Label=”Text” ValueExpression=”zusatzfelddblob('Text’)” Lines=”4” /> |
|
Image | Image |
<Image Label=”Image” ValueExpression=”zusatzfeldblob('image’)” Height=”150” /> |
|
Object | Address | AddressReferenceBox |
<AddressReferenceBox Label=”Address” ValueExpression=”zusatzfeldobj('ObjectAddress’)” /> |
Object | Vertec folder | TreeReferenceBox |
<TreeReferenceBox Label=”Folder” ValueExpression=”zusatzfeldobj('Objectfolder’)” BrowseClass=”Container” SelectFilter=”AbstractFolder” /> |
Object | AdditionalFieldComboBox |
<AdditionalFieldComboBox Label=”Object” ValueExpression=”zusatzfeldobj('Object’)” /> |
|
Selection | AdditionalFieldComboBox |
<AdditionalFieldComboBox Label=”Selection” ValueExpression=”zusatzfeldint('selection’)” /> |
|
Text | TextArea |
<TextArea Label=”Text” ValueExpression=”zusatzfeld('Text’)” Lines=”4” /> |
In most cases, this results in the same result on the interface, because, ultimately, it is usually a string.
The main difference is with selection type additional fields. These are implemented internally as integer additional fields. This means that the expression zusatzfeldint(name)
returns a number. If the text of the selection is to be shown, the expression zusatzfeldasstring(name)
should be used.
Similarly, the type-specific OCL operators return NULL values if the additional field is NULL. However, this is not a problem in most cases, since NULL values are rendered as empty strings. If a NULL value causes problems, this can be avoided by using zusatzfeldAsString
.
The operator additional fieldObj for querying object additional fields may result in errors when applied to a list of objects in an OCL expression. The error message is:
TBoldObjectList.AddElement: Element not a TBoldObject
Example: Object additional field 'Branch’ on project user. Indicates an address, for example.
offeneLeistungen.bearbeiter.zusatzfeldobj('Niederlassung')->asset->size
should indicate the quantity of different branches in a list of services. But gives the above error.
Solution
offeneLeistungen.bearbeiter->collect(zusatzfeldObj('Niederlassung')->oclasType(UserEintrag))->asset->size
Explanation
Applying zusatzfeldObj
to a list is equivalent to an implicit “collect” operation. This fails because zusatzfeldObj
does not return the linked object directly, but rather the linked field.
Converting the type to a compatible object type (actual type of the object or UserEntry) solves the problem. For the type conversion to take place, the collect
operation must be explicitly formulated.