Creating customized automatic values and calculated values can be specified in more detail by using M-Files API and generic features of VBScript ("Microsoft Visual Basic Scripting Edition"). This section provides instructions for using VBScript with automatic values.
The VBScript code for a calculated value is executed whenever a property value is edited. The VBScript code is used for calculating the automatic value, after which the result of the calculation must be assigned to a variable called Output. This value is stored as the value of the property in the object metadata.
The simplest piece of VBScript for formulating an automatic value might therefore look like this:
Output = "Automatic value"
Usually an automatic value uses other object properties, for example, by concatenating them. VBScript code can utilize the property values and basic information of the same or another object with the aid of the following VBScript variables:
|
|
|
For the variable descriptions, see VBScript Variables Explained.
Do the following steps to use VBScript for calculating an automatic value for a property: