Page Properties | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Ressourcesyuuvis® RAD - Client-side Form Scripting (parts will be taken over and be available with the next version 2.3 RemarksMartin B. is working on it together with Manuel and Stevan ... |
...
Note: When field data changes are made using a script (i.e., without user action) when loading the form, the Save option is not available. In contrast, you can disable fields to protect against user changes.
Script Scope
The relevant object is given to each client script under the name 'scope.' This object provides the API so the scripts can access the object fields and their properties.
Properties of 'scope'
Name | Description |
---|---|
api | Supplies access to the plug-in API, with 'session' (user information), 'dms' (object details, search via DMS-Service), 'http' (connection to any service), 'config', 'util' (helper functions) and 'agent' properties. |
data | Supplies all object fields defined in the object or process activity. The fields offer read-only access using the technical name. Available for release 2017-09-27 (3.22.x) or later. |
model | Supplies the flattened form model and all object fields defined on the form. The fields can be accessed with the technical name. The form groups cannot be accessed in this way. |
situation | Supplies the current form model situation. Scripts can respond to the relevant situation. Possible values are 'CREATE' (create), 'SEARCH' (search) and 'EDIT' (edit index data). |
objectId | Supplies the ID of the current DMS object if available (available since version 6.4). |
...
Even when not defined in the form (object forms as well as process task forms), you can access object field data or process variables by using this part of the scope. Use the technical name of the object type field or process model variable to read its value, as shown in the following example.
Check situation
...
1
2
3
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
if (scope.data.status) { |
...
// only fields not NULL are in the data object, so check for |
...
existence if (scope.data.status == 'active') { ... } |
...
} |
scope.situation
For object types, you can create a default form to be used for the situations CREATE, EDIT and SEARCH. In each situation, any included scripts are active.
If a general form is used, but different data management is necessary, it is possible to check which situation is given.
For example, how to deactivate a form script to be used in the situation 'SEARCH.'
...
Info | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
Read on
|