Artikel: AN0002155Aktualisiert: 21.09.2018
ObjectGears system supports wide scripting possibilities. Scripts extend possibilities of the basic settings about new more advanced functions. You can perform more sofisticated checks before data saving, work with data, start imports, exports, workflow or jobs.
All the scripts can work with fundamental functions (object OG). Based on the script type further objects specific for a certain use (see hereinafter) can be used.
How to write scripts
ObjectGears system uses for scripting JavaScript language, that is extended by custom objects and data types. Scripting is therefore simple and you need just elementary programming knowledge. We have prepared an overview of particular programming constructions to provide you with basic familiarization.
Script objects vs. data types
Please pay attention to some script objects having same names like OG data types. This naming is chosen because of transparency. Script objects contain functions for work with the given data type, whereas data type contains own data of the class, export, import...
E.g. this notation is used to read a record from the class:
var dr = OG.DataRow.GetDataById( 10, 100);
The command is using method GetDataById from the object script OG.DataRow and the method returns data type DataRow.
Special objects
There are also other script objectsof the ObjectGears system. They are used for a specific purpose, e.g. for some workflow activities. They are described in another chapter. Here is list of these objects:
Repeated use of scripts
In case when we need to use certain script several times, we can utilize blocks of scripts, functions of which can be called from various ObjectGears places (buttons, rules, workflow...). Take a look at an example.
Script testing
You can use Script window for testing the scripts or for script execution.