Document Project Copy Events
Document project copy events occur when documents created as project copies are modified of using the various Meridian Enterprise commands. Like other document events, these events also receive a Batch object. For more information about the Batch object, see Batch Object.
Document Project Copy Event Sequences
The events that occur for the document project copy commands are shown in the following lists in the sequence that they occur.
Create Project Copy event sequence
-
DocCopyMoveEvent_PrepareCopy
-
ProjectWorkflowEvent_PrepareBrowser
-
ProjectWorkflowEvent_InitializeExpandItem
-
ProjectWorkflowEvent_BeforeExpandItem
-
DocCopyMoveEvent_InitializeCopy
-
DocGenericEvent_InitializeNewDocument
-
DocGenericEvent_InitializeCalculateFileName
-
DocCopyMoveEvent_BeforeCopyWithReferences
-
DocProjectCopyEvent_ProjectCopyExist
-
DocCopyMoveEvent_BeforeCopy
-
DocCopyMoveEvent_AfterCopy
-
DocGenericEvent_BeforeNewDocument
-
DocGenericEvent_OnProperties
-
DocGenericEvent_AfterNewDocument
-
DocCopyMoveEvent_AfterCopyWithReferences
-
DocGenericEvent_TerminateCalculateFileName
-
DocGenericEvent_TerminateNewDocument
-
DocCopyMoveEvent_TerminateCopy
Confirm Merged with Master event sequence
-
DocGenericEvent_PrepareCommand
-
DocProjectCopyEvent_InitializeConfirmMerged
-
DocProjectCopyEvent_BeforeConfirmMerged
-
DocProjectCopyEvent_AfterConfirmMerged
-
DocProjectCopyEvent_TerminateConfirmMerged
Confirm Superseded by Master event sequence
-
DocGenericEvent_PrepareCommand
-
DocProjectCopyEvent_InitializeConfirmSuperseded
-
DocProjectCopyEvent_BeforeConfirmSuperseded
-
DocProjectCopyEvent_AfterConfirmSuperseded
-
DocProjectCopyEvent_TerminateConfirmSuperseded
Discard from Project event sequence
-
DocGenericEvent_PrepareCommand
-
DocProjectCopyEvent_InitializeDiscardFromProject
-
DocProjectCopyEvent_BeforeDiscardFromProject
-
DocProjectCopyEvent_AfterDiscardFromProject
-
DocProjectCopyEvent_TerminateDiscardFromProject
Link to Master event sequence
-
DocGenericEvent_PrepareCommand
-
DocProjectCopyEvent_BeforeLinkToMaster
-
DocProjectCopyEvent_AfterLinkToMaster
Release as Master Revision event sequence
-
DocProjectCopyEvent_PreInitializeReleaseToMaster
-
DocProjectCopyEvent_InitializeReleaseToMaster
-
The following two events ONLY occur if the master document does not yet exist:
-
DocGenericEvent_BeforeNewDocument
-
DocGenericEvent_OnProperties
-
-
The following four events ONLY occur if the master document does not yet exist AND if a parent folder has not yet been specified:
-
ProjectWorkflowEvent_PrepareBrowser
-
ProjectWorkflowEvent_InitializeExpandItem
-
ProjectWorkflowEvent_BeforeExpandItem
-
DocGenericEvent_DocumentFolderSelected
-
-
DocGenericEvent_AfterNewDocument: Occurs only if the master document does not yet exist.
-
The following two events ONLY occur if the master document does not yet exist AND an expression is configured for the Calculate file name option of the document type:
-
DocGenericEvent_BeforeCalculateFileName
-
DocGenericEvent_AfterCalculateFileName
-
-
DocProjectCopyEvent_PreBeforeReleaseToMaster
-
DocProjectCopyEvent_BeforeReleaseToMaster
-
The following two events ONLY occur if the project copy has been modified:
-
DocProjectCopyEvent_BeforeMasterUpdate
-
DocProjectCopyEvent_AfterMasterUpdate
-
-
DocProjectCopyEvent_AfterReleaseToMaster
-
DocProjectCopyEvent_TerminateReleaseToMaster
AfterLinkToMaster Event
Occurs when the user runs the Link to Master Document command.
Syntax
DocProjectCopyEvent_AfterLinkToMaster (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. |
Remarks
The Document object is the project copy during this event.
AfterMasterUpdate Event
Occurs after a new revision of a master document is updated from a project copy.
Syntax
DocProjectCopyEvent_AfterMasterUpdate (Batch, ProjectCopyDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
ProjectCopyDoc |
An object that represents the project copy document. |
AfterTransferToNext Event
Occurs when the user runs the Transfer to Next command.
Syntax
DocProjectCopyEvent_AfterTransferToNext (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. |
Remarks
The Document object is the project copy during this event.
AfterUnlinkFromMaster Event
Occurs when the user runs the Unlink from Master Document command.
Syntax
DocProjectCopyEvent_AfterUnlinkFromMaster (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. |
Remarks
The Document object is the project copy during this event.
BeforeLinkToMaster Event
Occurs when the user runs the Link to Master Document command.
Syntax
DocProjectCopyEvent_BeforeLinkToMaster (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. |
Remarks
The Document object is the project copy during this event.
BeforeMasterUpdate Event
Occurs before a new revision of a master document is updated from a project copy.
Syntax
DocProjectCopyEvent_BeforeMasterUpdate (Batch, ProjectCopyDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
ProjectCopyDoc |
An object that represents the project copy document. |
BeforeTransferToNext Event
Occurs when the user runs the Transfer to Next command.
Syntax
DocProjectCopyEvent_BeforeTransferToNext (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. |
Remarks
The Document object is the project copy during this event.
BeforeUnlinkFromMaster Event
Occurs when the user runs the Unlink from Master Document command.
Syntax
DocProjectCopyEvent_BeforeUnlinkFromMaster (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. |
Remarks
The Document object is the project copy during this event.
*ConfirmMerged Events
Occur when the user runs the Confirm Merged with Master command.
Syntax
DocProjectCopyEvent_*ConfirmMerged (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. This parameter is passed only to the Before and After events. |
Remarks
The Document object is the project copy during this event.
*ConfirmSuperseded Events
Occur when the user runs the Confirm Superseded by Master command.
Syntax
DocProjectCopyEvent_*ConfirmSuperseded (Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. This parameter is passed only to the Before and After events. |
Remarks
The Document object is the project copy during this event.
*DiscardFromProject Events
Occur when a project copy is discarded from a project workflow.
Syntax
DocProjectCopyEvent_*DiscardFromProject (Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
PreInitializeReleaseToMaster
This event is used to add a confirmation page before the InitializeReleaseToMaster event. This event can be used as part of a wizard.
Syntax
DocCopyMoveEvent_PreInitializeReleaseToMaster(Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
Remarks
Learn how to create confirmation pages. You can also see examples of this functionality in this Knowledgebase article.
PreBeforeReleaseToMaster
This event is used to add a confirmation page before the BeforeReleaseToMaster event. This event can be used as part of a wizard.
Syntax
DocCopyMoveEvent_PreBeforeReleaseToMaster(Batch, MasterDoc, ProjectCopyChanged)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc | An object that represents the master document from which the selected document was copied. This parameter is passed only to the Before and After events. |
ProjectCopyChanged | True if the project copy has been changed since it was copied from the master document. This parameter is passed only to the Before and After events. |
Remarks
Learn how to create confirmation pages. You can also see examples of this functionality in this Knowledgebase article.
ProjectCopyExist Event
Occurs when an attempt is made to create a project copy and another project copy already exists. The new project copy is not made and an error message is shown to the user.
Syntax
DocProjectCopyEvent_ProjectCopyExist(Batch, ProjectCopy)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
ProjectCopy |
An object that represents the existing project copy document. |
Remarks
The Document object is the source document during this event. Only changes made during this event are saved. Changes made in prior events are discarded.
*ReleaseToMaster Events
Occur when a project copy is released as a new revision of the master document from which it was copied.
Syntax
DocProjectCopyEvent_*ReleaseToMaster (Batch)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. This parameter is passed only to the Before and After events. |
ProjectCopyChanged |
True if the project copy has been changed since it was copied from the master document. This parameter is passed only to the Before and After events. |
*RequireMerge Events
Occur when the user runs the Require Merge command.
Syntax
DocProjectCopyEvent_*RequireMerge(Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. This parameter is passed only to the Before and After events. |
Remarks
The Document object is the project copy during this event.
*UndoMakeObsolete Events
Occur when the user runs the Undo Make Obsolete command.
Syntax
DocProjectCopyEvent_*UndoMakeObsolete (Batch, MasterDoc)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
MasterDoc |
An object that represents the master document from which the selected document was copied. This parameter is passed only to the Before and After events. |
Remarks
The Document object is the project copy during this event.
ValidateTargetFolder Event
Occurs when an attempt is made to create a project copy. The target folder can be evaluated by script and the user prevented from proceeding. If the folder is not valid, the ErrorMessage
is displayed.
Syntax
DocProjectCopyEvent_ProjectCopyExist(Batch, TargetFolder, ErrorMessage)
Name | Description |
---|---|
Batch |
An object that represents the batch of documents the user has selected. |
TargetFolder |
An object that represents the destination folder. |
ErrorMessage |
An object that represents the error message to be displayed. |
Remarks
This event is not supported when ActiveX compatibility mode is enabled.
Examples
Following are example implementations of this event.
1
2
3
4
5
Sub DocProjectCopyEvent_ValidateTargetFolder(Batch, TargetFolder, ErrorMessage)
If InStr (TargetFolder.Name, "Project") = 0 Then
ErrorMessage = "You can create project copies only in projects."
End If
End Sub
Example that gets the project name.
1
2
3
4
5
6
7
8
9
Sub DocProjectCopyEvent_ValidateTargetFolder(Batch, TargetFolder, ErrorMessage)
Dim sProjectName
If TargetFolder.IsProject Then sProjectName = TargetFolder.Name Else sProjectName = TargetFolder.ParentProject.Name
If InStr (TargetFolder.Name, "Master") > 0 And Not TargetFolder.ParentProject Is Nothing Then
ErrorMessage = ""
Else
ErrorMessage = "Please select the 'Masters' folder in " & sProjectName & "."
End If
End Sub
If you want to check if the parent project is in a project workflow:
Sub DocProjectCopyEvent_ValidateTargetFolder(Batch, TargetFolder, ErrorMessage)
If TargetFolder.ParentProject.WorkFlowState = AS_PWF_RELEASED Then
If TargetFolder.ParentProject.WorkFlowState = AS_PWF_RELEASED Then
ErrorMessage = "Please select another project; the current project status is 'Closed'."
End If
End If
End Sub