How to register scripts in Vertec
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
You can register frequently used scripts in the database. Script registered in this way do not have to be loaded and executed via the Script Editor, but can be called directly via a menu item.
To register a script, you need to create a script. To do this, right-click Script under Settings > Reports & Scripts and
select New > Script
. The following window will appear:
designation |
Under this name, the script will appear later in the menu, so make sure that the name is meaningful, but not too long. |
Platform |
From version 6.6. This field is used to indicate whether it is a Python Script or VBScript When executing the scripts, a distinction is made according to the platform setting whether VB or Python is executed. |
Classes |
Specify for which classes the script can be executed. If a name is not present in the selection, it can also be typed in by hand. All classes in Vertec are valid. Note that class names must be capitalized. |
Condition |
Here you can specify a display condition, which can be used to control whether the script appears in the Actions menu or not. This is done via OCL Expression in the Condition field. Clicking on the button with the three dots opens the expression editor. The result of this expression must return a Yes/No value (Boolean). Only if the condition is met will the script appear in the Actions menu. This applies only to scripts on individual objects. Scripts configured to display on lists will not evaluate the condition. |
Applicable to individual objects |
Check this box if the script can be applied to the individual object, in the example on a single project. |
Applicable to lists (containers) |
Check this box if the script can be executed on a list of objects, e.g. on a list of projects. |
Event script for |
Used only if you want to register scripts on events. This includes the following options:
|
Script text |
Enter the script code here. You can create it directly here or copy/paste it from an existing script here. It can be Vbscript (Attention: not cloud-cloud ready) or Python code, the system interprets it automatically. As a condition: Python scripts must start with a # . |
Execute |
To execute the script for testing purposes, click the Run button. Execute Make sure that the current context must be correct to test a script. Otherwise, you must run the test on the relevant regarding using the Actions menu button. |
Script Editor |
Opens the script, if it is a Python script, directly in the Script Editor . The criterion is: The script text begins with a #. The script editor is then directly linked to the Script. This means that if code is modified here, the script text in the script will also change. |
If a script is registered for the currently displayed object, in the example a single project, you can execute it via the menu button Actions or with the right mouse button.
Note that registered scripts are executed directly, so no window will open in advance where you can view the script code. If you need to change the script code, you can change it in the Settings > Script
folder in the desired script.
To unregister, you have two options:
Applicable to individual objects
AND Applicable
to lists (containers) and set Event event script to None. This will prevent the script from being invoked anywhere, but it will remain in the system.