Automatic values offer increased utilization of document and object metadata in storing and searching for information. In addition, using automatic values makes the naming of documents and objects more consistent and reduces the need for repeated data entries.
Creating an automatic value can be specified in more detail by using the M-Files API and generic features of VBScript. A calculated value is defined for the property.
Configuring a Calculated Value for a Property
To configuring an Automatic Value for a Property via VBScript, click the Edit Code.. button as shown below from the Automatic Values tab of the Property Definition dialog. Make sure the Calculation Order is set to a number higher than any other property you refer to when calculating your value. The default Calculation order is 100 for new properties, so we set this to 1000 to make sure it is calculated after all other properties have received a value.
![](http://solutionbench.com/sb/wp-content/uploads/2016/06/configuring-a-calculated-value-for-a-property.png)
Sample VBScript Code to Calculate a Date
This code example calculates a disposition date based upon the values of two other properties for the document.
![](http://solutionbench.com/sb/wp-content/uploads/2016/06/sample-vbscript-code-to-calculate-a-date.png)
Example in Action
Here, we can see a document that has a calculated property value for Disposition Date that is 3 Years after the Retention Start Date property because the Retention Schedule was set to SRS3.
![](http://solutionbench.com/sb/wp-content/uploads/2016/06/example-in-action.png)
Recent Comments