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
Scripts in vertec can be registered as menu items, as event scripts or as modules.
This article is about registering scripts as menu items. You can find out how to register Scripts on events or Scripts as modules in the separate articles.
You need Administrator Rights to register scripts.
In Settings > Reports & Scripts, right-click Scripts and select Neu > Scripteintrag
.
Activate the checkbox In Vertec Menüs anzeigen
:
In Vertec versions before 6.7.0.12, this checkbox is not yet available. In this case, just read on.
designation |
Under this name, the script will appear later in the Actions menu, so make sure that the name is meaningful, but not too long. |
Platform |
Here you can specify which (code) language the script is:
In Vertec versions before 6.6, this field does not exist yet. In this case, the script text must start with a # if it is a Python script. |
Classes |
Specify here for which type of objects (classes) the script can be executed in Vertec. The menu item appears in the Actions menu (or in the context menu) only where it was registered for. If a class does not exist in the selection, it can also be typed into the field by hand. Note that class names must be capitalized. Versions before 6.7.0.12: Valid are all Classes . Scripts cannot be registered on containers (folders). in Vertec that inherit from the classVersions from 6.7.0.12 on scripts of the new type (see section ): All Classes in Vertec that inherit from the class entry are valid. Scripts can also be registered on containers (folders, expression folders, link containers, etc.). |
Display condition |
Here you can specify a display condition as an OCL expression, with which you can control whether the script appears in the Actions menu (or in the context menu) or not. 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. Versions before 6.7.0.12The condition applies only to scripts on individual objects. Scripts configured to display on lists will not evaluate the condition. The OCL expression refers to the
Versions from 6.7.0.12For scripts of the new type (see section Changes from vertec version 6.7.0.12
), the display condition refers to the list of selected objects (
|
Applicable to individual objects |
Vertec Versions before 6.7.0.12. Check this box if the script can be applied to the individual object (e.g. to an invoice). For scripts registered before 6.7.0.12, this checkbox can be found on the More Info page after the update to 6.7.0.12. See section |
Applicable to lists (containers) |
Vertec Versions before 6.7.0.12. Check this box if the script can be applied to a list of objects (e.g. a project list). For scripts registered before 6.7.0.12, this checkbox can be found on the More Info page after the update to 6.7.0.12. See section Changes from vertec version 6.7.0.12 |
Extended user rights |
If registered scripts should later be able to be executed by users with restricted user rights, an extended permission can be accepted for the corresponding code points. See the article Extended user rights in scripts . |
Script text |
This is where the script code is inserted. See the section Code in scripts as menu items below. |
Execute... |
To run the script for testing purposes, click the Run button. Make sure that the up-to-date context is correct to test a script. Otherwise, you have to run the test on the relevant entry using the Actions menu button. |
Script Editor... |
Opens the script, if it is a Python script, in the Script Editor . The Script Editor is then linked to the script entry. This means that if code is modified in the Script Editor, the script text in the script entry also changes. |
Scripts on individual objects can either use the Actions menu:
Or by right-clicking:
Scripts on lists can be executed from the Actions menu or by right-clicking on the folder:
For scripts of the new type (see section Changes from Vertec version 6.7.0.12), scripts can also be executed on selected objects:
If such a script is executed like a conventional list script via the Actions menu or by right-clicking on the container (folder), all entries of the list are passed:
The script code must be valid Python code (or obsolete VBScript). The entire Vertec object model is accessible from the script.
The checkboxes Auf einzelne Objekte anwendbar
or Auf Listen (Container) anwendbar
are removed from the main page of the script entry.
In Vertec Menüs anzeigen
shown on the main page. In this case, the new behavior takes effect (Code from vertec 6.7.0.12
).The variable argobject
is not available in the script. Instead, there is the variable selectedobjects
. This contains the list of objects selected for the execution of the script:
currentobject
which contains the container (folder).for obj in selectedobjects: ...
The variable argobject
returns the up-to-date object (the up-to-date entry) in Vertec.
projekt = argobject
currentobject
which contains the parent container (folder).argobject.eintraege
callable. projektlist = argobject.eintraege for projekt in projektlist: ...