Document Generic Events
These are events that do not fall under any of the other document event categories.
Document Generic Event Sequences
The events that occur for the document generic commands are shown in the following lists in the sequence that they occur.
Change Document Type event sequence
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializeChangeDocumentType
-
DocGenericEvent_BeforeChangeDocumentType
-
DocGenericEvent_AfterChangeDocumentType
-
DocGenericEvent_BeforeNewDocument
-
DocGenericEvent_OnProperties
-
DocGenericEvent_AfterNewDocument
-
DocGenericEvent_TerminateChangeDocumentType
Delete event sequence
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializeDelete
-
DocGenericEvent_BeforeDelete
-
DocGenericEvent_AfterDelete
-
DocGenericEvent_TerminateDelete
Draft Print event sequence 1
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializePrint
-
DocGenericEvent_BeforePrint
-
DocGenericEvent_AfterPrint
-
DocGenericEvent_TerminatePrint
Issue New Filename event sequence
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializeCalculateFileName
-
DocGenericEvent_TerminateCalculateFileName
New Document event sequence4
-
DocGenericEvent_BeforeSelectDocumentType
-
DocGenericEvent_InitializeNewDocument3
-
DocGenericEvent_InitializeCalculateFileName3
-
DocGenericEvent_SelectTarget
-
DocGenericEvent_BeforeNewDocument
-
ProjectWorkflowEvent_PrepareBrowser5
-
ProjectWorkflowEvent_InitializeExpandItem5
-
ProjectWorkflowEvent_BeforeExpandItem5
-
DocGenericEvent_DocumentFolderSelected5
-
DocGenericEvent_OnProperties3
-
ProjectWorkflowEvent_PrepareBrowser6
-
ProjectWorkflowEvent_InitializeExpandItem6
-
ProjectWorkflowEvent_BeforeExpandItem6
-
DocGenericEvent_DocumentFolderSelected6
-
DocGenericEvent_AfterNewDocument
-
DocGenericEvent_BeforeCalculateFileName8
-
DocGenericEvent_AfterCalculateFileName8
-
DocGenericEvent_TerminateCalculateFileName3
-
DocGenericEvent_TerminateNewDocument3
Open in Application event sequence2
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializeOpenInApplication
-
DocGenericEvent_BeforeOpenInApplication
-
DocGenericEvent_AfterOpenInApplication
-
DocGenericEvent_TerminateOpenInApplication
Prepare for Offline Work event sequence1
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializePrepareForOffline
-
DocGenericEvent_BeforePrepareForOffline
-
DocGenericEvent_AfterPrepareForOffline
-
DocGenericEvent_TerminatePrepareForOffline
Redline event sequence
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_BeforeEditRedlines1
-
DocGenericEvent_AfterEditRedlines
Refresh Thumbnail event sequence1
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializeUpdateThumbnail7
-
DocGenericEvent_BeforeUpdateThumbnail
-
DocGenericEvent_AfterUpdateThumbnail
-
DocGenericEvent_TerminateUpdateThumbnail7
Rename event sequence
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_InitializeRename
-
DocGenericEvent_BeforeRename
-
DocGenericEvent_AfterRename
-
DocGenericEvent_TerminateRename
Replace Content event sequence1
-
DocGenericEvent_PrepareCommand
-
DocGenericEvent_BeforeReplaceContent
-
DocGenericEvent_AfterReplaceContent
Notes
-
Does not occur in PowerWeb.
-
Occurs in PowerWeb when documents are downloaded.
-
Does not occur when new documents are created by the Document Import tool in PowerUser.
-
Does not occur when new documents are created by the Database Import Wizard in Configurator.
-
Occurs only if Client.Confirmation (AS_CONFIRM_NO_SELECTPROJECTWIZARD) = False and Document.ParentFolder is not a valid folder.
-
Occurs only if Client.Confirmation (AS_CONFIRM_NO_SELECTPROJECTWIZARD) = True and Document.ParentFolder is not a valid folder.
-
Does not occur if the Refresh thumbnail button on the Document page is clicked.
-
Occurs only if an expression is configured for the Calculate file name option of the document type.
DocGenericEvent_AfterCreateReference Event
Occurs after a reference between documents has been manually created by a user.
Syntax
DocGenericEvent_AfterCreateReference(Batch, RefType, TargetDocument, [RefDisplayName])
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
RefType |
Name of the reference type assigned to the reference. |
TargetDocument |
Document object to which the reference was made. |
RefDisplayName |
Name that was assigned to the reference. The value may be set as described in DocGenericEvent_BeforeCreateReference event. |
DocGenericEvent_AfterDeleteReference Event
Occurs after a reference between documents has been manually deleted by a user.
Syntax
DocGenericEvent_AfterDeleteReference(Batch, RefType, TargetDocument, [RefDisplayName])
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
RefType |
Name of the reference type assigned to the reference. |
TargetDocument |
Document object to which the reference was made. |
RefDisplayName |
Name that was assigned to the reference. |
Remarks
If the Batch.Abort method was called in the DocGenericEvent_BeforeDeleteReference event from PowerWeb, the reference was not be deleted.
DocGenericEvent_AfterEditRedlines Event
Occurs after documents are redlined by a user with the Meridian viewer.
Syntax
DocGenericEvent_AfterEditRedlines(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
DocGenericEvent_AfterReplaceContent Event
Occurs after a user replaces the content of documents.
Syntax
DocGenericEvent_AfterReplaceContent(Batch, SourceFile)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
SourceFile |
A string containing the path and filename of the source file selected by the user to replace the document's content. |
DocGenericEvent_BeforeCreateReference Event
Occurs before a reference between documents is manually created by a user.
Syntax
DocGenericEvent_BeforeCreateReference(Batch, RefType, TargetDocument, [RefDisplayName])
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
RefType |
Name of the reference type that will be assigned to the reference. |
TargetDocument |
Document object to which the reference will be made. |
RefDisplayName |
Default name that will be assigned to the reference. This parameter is not supplied in all cases. The value may be set in this event procedure. |
DocGenericEvent_BeforeDeleteReference Event
Occurs before a reference between documents is manually deleted by a user.
Syntax
DocGenericEvent_BeforeDeleteReference(Batch, RefType, TargetDocument, [RefDisplayName])
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
RefType |
Name of the reference type assigned to the reference. |
TargetDocument |
Document object to which the reference was made. |
RefDisplayName |
Name that was assigned to the reference. |
Remarks
If the Batch.Abort method is called in this event from PowerWeb, the reference will not be deleted.
DocGenericEvent_BeforeEditRedlines Event
Occurs before documents are redlined by a user with the Meridian viewer.
Syntax
DocGenericEvent_BeforeEditRedlines(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
DocGenericEvent_BeforeReplaceContent Event
Occurs before a user replaces the content of documents.
Syntax
DocGenericEvent_BeforeReplaceContent(Batch, SourceFile)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
SourceFile |
A string containing the path and filename of the source file selected by the user to replace the document's content. |
Remarks
Importing a document using drag and drop on a released document will create a new revision. Depending on your organization's business process for this action, the document might need to be placed in different workflow state, for example, for review before the new content can be released. We recommend that you do that in this event. If this event handler is not customized, an Access is denied error will result and the action will fail. If the document should remain in the released state after the import, this event handler should still be implemented to place the document in a different workflow state and then the document released in the DocGenericEvent_AfterNewDocument event handler.
By default, the redlines for the existing document content will be deleted when the content is replaced. If the redlines should be retained (to check that changes to the document have been done properly, for example), you can prevent the redlines from being deleted by setting the AS_CONFIRM_CLEANREDLINESONREPLACECONTENT constant to False in this event. The default is True.
DocGenericEvent_BeforeSelectDocType Event
Outputs the list of available document types to show the user based on the type of operation being carried out such as a new document or change the document type.
Syntax
DocGenericEvent_BeforeSelectDocumentType(Batch, DocTypeList)
Name | Description |
---|---|
Batch |
An object that represents the action the user has selected. |
DocTypeList |
A semicolon-delimited list of available document types for the action being carried out. |
Remarks
This functionality is only available in PowerWeb. On wizard pages, this event is fired once.
DocGenericEvent_*CalculateFilename Events
Occurs when the filename of a document is calculated by its document type.
Syntax
DocGenericEvent_*CalculateFilename(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
DocGenericEvent_*ChangeDocumentType Events
Occurs when a user changes the document type of documents.
Syntax
DocGenericEvent_*ChangeDocumentType(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
NewType |
Passed only to the BeforeChangeDocumentType procedure because at that moment the document type has not yet been changed. |
OldType |
Passed only to the AfterChangeDocumentType procedure because the document type has already been changed. |
DocGenericEvent_*Delete Events
Occurs when documents or folders are deleted by a user.
Syntax
DocGenericEvent_*Delete(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of objects the user has selected. |
Remarks
When a user deletes a folder, the Document object is Nothing. When a user deletes a document, the Document object is the document being deleted. When a user deletes a folder that contains one or more documents, the events occur once for each document and then once for the parent folder.
Example
Sub DocGenericEvent_BeforeDelete(Batch) If Not Document Is Nothing Then Batch.PrintDetails "Before delete " + Document.FileName ElseIf Not Folder Is Nothing Then Batch.PrintDetails "Before delete " + Folder.Name End If End Sub
DocGenericEvent_DocumentFolderSelected Event
Occurs after the project folder selection dialog box has been shown to the user to select the destination folder for a new project copy document. Also shown to select a master document folder when releasing new project documents as new master documents.
The project folder selection dialog box can be controlled with the ProjectWorkflowEvent_PrepareBrowser, ProjectWorkflowEvent_InitializeExpandItem, and ProjectWorkflowEvent_BeforeExpandItem event procedures
Syntax
DocGenericEvent_DocumentFolderSelected (Batch, SelectedFolder)
Name | Description |
---|---|
Batch |
An object that represents the batch of master documents the user has selected. |
SelectedFolder |
The name of the folder selected by the user. |
Remarks
If Client.Confirmation (AS_CONFIRM_NO_SELECTPROJECTWIZARD) is False after the DocGenericEvent_BeforeNewDocument event and Document.ParentFolder is not a valid folder at the time that the new document properties must be set, the folder selection dialog box is shown before the DocGenericEvent_OnProperties event in order to set the destination folder.
If Client.Confirmation (AS_CONFIRM_NO_SELECTPROJECTWIZARD) is True after the DocGenericEvent_OnProperties event and Document.ParentFolder is still not a valid folder, the folder selection dialog box is shown before the DocGenericEvent_AfterNewDocument event.
The selected folder is set as the Folder object in the DocGenericEvent_OnProperties and DocGenericEvent_AfterNewDocument events.
DocGenericEvent_*NewDocument Events
Occurs when documents are created by a user with any method (template, import, Application Integration). Also when a document is moved to a different folder or changed to a different document type.
Syntax
DocGenericEvent_*NewDocument(Batch, Action, SourceFile, DocType, DocTemplate)
Remarks
We recommend not setting any property values in the BeforeNewDocument event as this might cause the document to be created in a temporary parent folder before it is moved to its final destination, which might cause conflicts with existing documents.
The Before and After procedures are invoked when documents are imported with the Document Import tool. The Initialize and Terminate procedures are not invoked by the Document Import tool and are invoked only once per batch by the PowerWebImport Documents command. The FailCurrent and Abort methods of the Batch object are also available; however, the BatchIndex property will always be 1.
When documents are imported using drag-and-drop, the source of the files cannot be determined by Meridian so the value of the Client.ClientID property is AS_CID_POWERUSER regardless of the source of the documents. For your script to know where the documents originated from to perform validation or other processing, the users must use the file commands that are provided by the Meridian application links.
Example
You can test the value of the $$ICIMP_PropInvalid batch argument to determine if property validation failed while running the Document Import tool. If the validation failed, then you can prevent the import of the failed document using code similar to the following example.
Sub DocGenericEvent_BeforeNewDocument(Batch, Action, SourceFile, DocType, DocTemplate)
If CBool(Batch.Argument("$$ICIMP_PropInvalid")) = True Then Batch.FailCurrent("Property validation failed") End If End Sub
Use the object argument Batch.Argument("__$$RelatedProjectCopy") to obtain the project copy that is being released as a master document. It can be useful to calculate the location for the master document location if it is being created for the first time.
Use the object argument Vault.Argument("__$$RelatedTransmittal") to relate a transmittal to a new submittal. Use the object argument Vault.Argument("__$$SubmittalSender") to relate a person to a new submittal.
For more information, see Object Arguments.
DocGenericEvent_OnProperties Event
Occurs when a user views or edits the property pages of a document or folder.
Syntax
DocGenericEvent_OnProperties(Command, Abort)
Remarks
This event occurs in the Meridian client applications when Command includes the constants indicated in the following table.
Constant | Action | PowerWeb | PowerUser |
---|---|---|---|
AS_PS_CMD_VIEW |
The user started viewing the property page. |
|
|
AS_PS_CMD_EDIT |
The user clicked Edit to start property page (wizard) editing. |
|
|
AS_PS_CMD_APPLY1 |
The user clicked Next to apply changes to the current page. |
|
|
AS_PS_CMD_FINISH |
The user clicked Finish to apply changes to the last page and stop property page (wizard) editing. |
|
|
AS_PS_CMD_CANCEL |
The user clicked Cancel to discard changes and stop property page (wizard) editing. |
|
|
This constant is represented in PowerUser only when the Finish button is clicked at the end of a wizard. In PowerWeb, it is included every time the Next button is clicked for a wizard page. Property values may not be set in PowerWeb if this constant is represented.
This event does not occur in PowerWeb when creating folders.
Use this event with much caution. In PowerUser, when Command includes AS_PS_CMD_VIEW, setting Abort to True will prevent display of all property pages. Attempting to set property values at that time can cause errors such as "The object is currently being edited by another session" and lost data.
We recommend that you not execute other actions, make modifications to the document content, invoke anything that takes a relatively long time, or invoke any user interface functions during this event. Such actions can have unexpected or unpredictable results.
DocGenericEvent_*OpenInApplication Events
Occurs when documents are opened by a user in their native application.
Syntax
DocGenericEvent_*OpenInApplication(Batch, AppName)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
AppName |
A string that contains the name of the application in which the documents will be opened. This is the name of the application registered in Windows on the user's computer for the file type of the documents. |
DocGenericEvent_PrepareCommand Event
Occurs after a user selects a document command on the shortcut menu to act upon the selected document.
Syntax
DocGenericEvent_PrepareCommand(Batch, CmdID)
Name | Description |
---|---|
Batch |
An object that represents the current batch of documents. |
CmdID |
A string that identifies the internal name of the command. For the identifiers that may be used, see Meridian Enterprise command identifiers. |
Remarks
Not available in PowerWeb. This event is intended to be used to set the Batch.ProcessAsBatch property to True before programmatically adding documents with the Batch.AddDocuments method to a batch in a custom command's Initialize event.
DocGenericEvent_*PrepareForOffline Events
Occurs when a user prepares documents for offline mode operation.
Syntax
DocGenericEvent_*PrepareForOffline(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
DocGenericEvent_*Print Events
Occurs when documents are printed by a user from Meridian with the viewer. For information on configuring watermark printing with the Watermark properties,
Syntax
DocGenericEvent_*Print(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
Remarks
The DocGenericEvent_AfterPrint event does not occur in PowerWeb.
DocGenericEvent_*Rename Events
Occurs when documents or folders are renamed by a user.
Syntax
DocGenericEvent_*Rename(Batch, NewName)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
NewName |
A string that contains the new name entered by a user. |
DocGenericEvent_SelectTarget Event
Occurs when a new document is created by the Create New and Add Document commands. This event can be used to show the user a dialog box for folder, projects, or no dialog box.
Syntax
DocGenericEvent_SelectTarget (Batch, TargetFolder, DialogToShow)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. This event occurs once for each document in the batch. |
TargetFolder |
An object that represents the destination folder. This event can set the destination folder. |
DialogToShow |
The type of dialog box to show for project selection, one of the AS_SELECT_DIALOG_TYPE constants. |
Remarks
The Document object in this event is the new document. This event is equivalent to the AS_CONFIRM_NO_SELECTPROJECTWIZARD constant. For the corresponding event for copied documents, see DocCopyMoveEvent_SelectTarget event.
DocGenericEvent_*UpdateThumbnail Events
Occurs when a user updates the thumbnail images of documents manually.
Syntax
DocGenericEvent_*UpdateThumbnail(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
DraftPrint_SetWatermark Event
Occurs when documents are printed by a user from Meridian Explorer with the viewer.
Syntax
DraftPrint_SetWatermark