File Name Calculation
A document type’s Calculate file name option allows you to configure automatic file names for all documents created with that document type. Every document type can use the same or a different file name calculation. This makes it relatively easy for all of your Meridian vault documents to use your organization’s naming standards. File names can be calculated when documents are created in the vault, as needed by users invoking the Issue New file name command, and optionally when existing documents are imported into a vault.
In Meridian vaults, a document’s Name property is used as its file name. Changing one also changes the other. The terms document name and file name are synonymous where used in this guide.
Document names are calculated by a VBScript expression that you must type in the Calculate file name option. You can use the Meridian Enterprise Script Editor to build the expression from any of the Meridian objects, properties, and functions available in the Meridian Enterprise Script Editor. For information on using VBScript for configuration expressions including their limitations, see the Accruent Meridian Enterprise VBScript API Reference.
This means that you can combine text from several places to calculate file names:
- Part or all of property values, such as a document’s title, project, trade discipline, and so on
- Part or all of the name of the template used to create the document
- Normal text
- Any valid Windows characters
- Sequential numbers managed by Meridian
File names must include a file extension so that the correct document type can be applied, hybrid parts detected, and the correct applications started. If the Calculate file name expression does not calculate a valid file extension, Meridian Enterprise will append the file extension from the document template that was used to create the document or from the original document.
To build a file name calculation expression, use VBScript to retrieve and format property values, sequential numbers, and other text elements, and then concatenate them.
For example, the following VBScript expression calculates a file name composed of the document type name, the next sequential number based upon the document type formatted to four characters in length, and the document’s title:
Document.DocumentType.DisplayName & " " & _
FormatSequenceNum(Document.DocumentType.Sequence.Next, 4) & _ " " & Document.Title
This expression would produce a file name similar to:
Drawing 0123 Site Plan
For more information on using VBScript, property values, and sequence numbers, see the Accruent Meridian Enterprise VBScript API Reference.