Scripts
General

Additional parameters are available with the internal names of the folder type and the object type for the 'OnObjectHistoryEntry' general server event:
oscabinetinternalname/ostypeinternalname
enaio® client: New Script Features

Event scripts for enaio® client are no longer being encrypted. Encrypted scripts can still be imported.

Text fields can be marked as a mandatory field via event scripts.
For example: asfile.ActivePage.ASFields.Item("feld").Required = true
Existing mandatory field properties from enaio® editor cannot be suspended.

Index data of text fields on forms can be color coded via scripts. The RGB value is entered.
For example: asfile.ActivePage.ASFields("feld").TextColor = RGB(33,255,59)
Workflow scripts that previously specified the color via the 'Flags2' parameter need to be switched to the 'TextColor' parameter.

It was previously the case that the 'OnCreateCopy' and 'OnMove' events did not run if the object already existed at the new location. Now the events are executed. The handoff file contains the new parameter OBJECTEXISTONTARGETLOCATION. Values: 1 (object exists)/0 (object does not exist).

The event will now be executed if users have already selected a value from a catalog or add-on dialog, and not just after leaving the field.
enaio® webclient: New Script Features
Some of the events and new features have already been introduced with service releases for enaio® webclient 9.0.

Whether customers do not want to lose file names during storage or the original name of the file contains important information, the formHelper.getFileInfo() method returns file names in the 'AfterValidate' and 'BeforeValidate' events and can be written to index data fields, for example. This only applies to the creation of new documents, but not e-mails.

A hit list can be opened for a list of objects using the openResultListByIds method.
Parameters
- Open a hit list in the active tab or in a new browser tab (in enaio® mobile always in the active tab)
- List of IDs: with information about the object ID and the object type ID for each object
- Optional: specify the title and description of the hit list window
- Optional: for hit lists with one entry, execute the standard action (default) or open the hit list

- It is generally not possible to open more than one tab in a mobile environment. If it is defined in a script that another tab should open, then enaio® mobile will always open the display in the currently opened tab
- The AfterValidate event is executed after the index data has been validated. Previously, this action could only transfer or cancel the action, not make further changes to the data. Now, changed data can be transferred with a return value of '2'.

The following events are now available for enaio® webclient:
- AfterLogin: after login and before enaio® webclient is shown.
- OnAddLocation: before another location is added to a document.
- OnCreateCopy: before creating the copy of a register or document.
- BeforeOpen: before opening a folder, register, or document.
- BeforeStartQuery: before starting a query.
- OnMove: before moving a register or document.

Two types of global scripts can be included for enaio® webclient:
-
GlobalWebClientScript: global script for which all object type scripts can access the contents.
-
GlobalWebClientObjectTypeScript: global script for which all scripts of the object types of the folder type can access the contents.

Events can be used to output notifications via toaster via the 'formHelper' object:

Text fields can be marked as mandatory fields via event scripts.
Existing mandatory field properties from enaio® editor cannot be suspended.

The pages of page controls can be addressed by internal name:
formHelper.getFieldsFromPageControl({internal}, {pageIdentifier})

A script allows access to initial index data of a field, even if it has been edited:

Scripts can determine on which device and operating system the application is running and respond to differences:

The object that is shown in the preview area can be specified via scripts:

Executable programs on client machines can be accessed from enaio® webclient as a desktop application:
formHelper.execProgramAsync({pathToProgram}, {programArguments}, {returnResult})

The function createPseudoCatalog({catalogConfig},{dataCallback}), which assigns catalog functions to fields, has been extended by the 'hideValues' parameter via which values from gathered data can be hidden.

It is possible to react to the marking of a table row and to changes of the marking via a script: