How to configure additional fields
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|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 invalid and 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 view and show additional field items 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 field items on already existing Vertec objects are not created until they are accessed accordingly. Before they are not present in the database, which is Access via SQL but essential.
When a new object is created, all associated additional field classes are created.
For already existing objects, the additional field classes are created in the following operations:
projekt.jahr = 2022
(Example: integer add-on field jahr
on project). It 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 item, 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 custom field items on classes of which objects already exist should always be created directly.
After creating an additional field, you can Run script , which creates the field on all existing objects, such as:
projects = vtcapp.evalocl(“project”)
for project in projects:
project year = 0
vtcapp.updatedatabase()
How the different additional field types are initialized can be found in the section Python 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 | custom field item |
Empty string |
True, False | additional fieldbool |
Wrong |
Integer number | additional fieldint |
0 |
Minutes | additional fieldint |
0 |
Fixed-point number | additional fieldcurr |
0.00 |
Date | additional field date |
NULL |
Image | additional field blob |
NULL |
Object | additional fieldobj (see tips below) |
NULL |
Selection | additionalfieldint (returns the position of the selection)additionalfieldasstring (returns the selection text) |
0 First value of the list |
Text | zusatzfeld |
Empty string |
ANSI Text (Legacy) | additional field blob |
NULL |
Example: All addresses marked as ABC addresses (True,False Additional field “ABC address” on address):
address entry->select(additional fieldbool('ABC address’))
Access to additional field classes in Python is simple via the additional field name, e.g. projekt.jahr
.
Read-only access ( myyear = projekt.jahr
) does not create the field (see section When are custom field items created
above), on the other hand, the write access already exists ( 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 number | = 0 |
Minutes | = 0 |
Fixed-point number | = 0 |
Date | = None |
ANSI Text | = None |
Image | = None |
Object | = None |
Selection | = 0 |
Text | = None |
The different additional field classes can be accessed via SQL as follows:
Additional field type | Expression SQL (database field) | Where expression |
---|---|---|
String |
Value | Value like “Aha%” |
True, False |
ValueBoolean |
|
Integer number |
ValueInteger | ValueInteger >= 1000 |
Minutes |
ValueInteger | ValueInteger >= 1000 |
Fixed-point number |
ValueCurrency | ValueCurrency = 1350 |
Date |
ValueDate | ValueDate = “Mar 15, 2017” |
ANSI Text |
ValueBlob | ValueBlob containing 'Newsletter’ (Firebird)ValueBlob like “%Newsletter%” (MS SQL) |
Image |
ValueBlob | ValueBlob <> ““ (for: there is an image assigned) |
Object |
ValueObject |
|
Selection |
ValueInteger |
|
Text | ValueText | WertText like "%Newsletter%" |
For a detailed description and examples, see SQL expressions for SQL folders.
Additional field classes can also be placed in lists and pages via customizing. The following matrix applies to the selection of the control:
Field type | Selection type | Control element | Example |
---|---|---|---|
String | Address | AddressReferenceBox |
<AddressReferenceBox Label=”Address” ValueExpression=”additional fieldobj('character address’)” /> |
String | File | PathBox |
<PathBox Label=”File” ValueExpression=”additional field('File’)” SelectType=”FileOpen” /> In order to be able to open the file directly, a navigation button must be inserted: <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=”Path” ValueExpression=”additional field('path’)” ShowNavLinkButton=”True” SelectType=”Folder” /> |
String | Textbox |
<TextBox Label=”Zeichen” ValueExpression=”zusatzfeld('Zeichen’)” /> |
|
True, False | Checkbox |
<CheckBox Label=”True, False” ValueExpression=”additional fieldbool('TrueFalse’)” /> |
|
Integer number | Textbox |
<TextBox Label=”Integer” ValueExpression=”additional fieldint('integer’)” /> |
|
Minutes | Textbox |
<TextBox Label=”Minutes” ValueExpression=”additionalfieldint('Minutes’)” Converter=”Minutes” /> |
|
Fixed-point number | Textbox |
<TextBox Label=”Fixed point number” ValueExpression=”additional fieldcurr('fixed point number’)” /> |
|
Date | DatePicker |
<DatePicker Label=”Date” ValueExpression=”additional fielddate('Date’)” /> |
|
ANSI Text | TextArea |
<TextArea Label=”Text” ValueExpression=”additional fieldblob('Text’)” Lines=”4” /> |
|
Image | Image |
<Image Label=”Image” ValueExpression=”additional fieldblob('image’)” Height=”150” /> |
|
Object | Address | AddressReferenceBox |
<AddressReferenceBox Label=”Address” ValueExpression=”additionalfieldobj('ObjectAddress’)” /> |
Object | Vertec folder | TreeReferenceBox |
<TreeReferenceBox Label=”Folder” ValueExpression=”additionalfieldobj('Objectfolder’)” BrowseClass=”Container” SelectFilter=”AbstractFolder” /> |
Object | AdditionalFieldComboBox |
<AdditionalFieldComboBox Label=”Object” ValueExpression=”additionalfieldobj('Object’)” /> |
|
Selection | AdditionalFieldComboBox |
<AdditionalFieldComboBox Label=”Selection” ValueExpression=”additional fieldint('selection’)” /> |
|
Text | TextArea |
<TextArea Label=”Text” ValueExpression=”zusatzfeld('Text’)” Lines=”4” /> |
In most cases, this results in the same result on the interface, because in the end it is usually a string.
The main difference is with selection extension fields. These are implemented internally as integer custom field items. This means that the expression extensionint(name)
returns a number. If the text of the selection is to be shown, the expression extensionasstring(name)
should be used.
Similarly, the type-specific OCL operators return NULL values if the custom field item is NULL, but 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 the extension fieldAsString
.
The extensionObj operator for querying object extension 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 add-on field 'Branch’ on project user. Point to an address, for example.
openservices.processor.additional fieldobj('branch’)->asset->size
should indicate the quantity of different branches in a list of services. But gives the above error.
Solution
openservices.processor->collect(additional fieldObj('branch’)->oclasType(UserEntry))->asset->size
Explanation
Applying additionalfieldObj
to a list is equivalent to an implicit “collect” operation, which fails because additionalfieldObj
does not return the linked object directly, but the linked field.
Converting the type to a compatible object type (the actual type of the object or User Entry) solves the problem. For the type conversion to take place, the collect
operation to be explicitly formulated.