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.

ClosedDocument 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.

ClosedCreate Project Copy event sequence

  1. DocCopyMoveEvent_PrepareCopy

  2. ProjectWorkflowEvent_PrepareBrowser

  3. ProjectWorkflowEvent_InitializeExpandItem

  4. ProjectWorkflowEvent_BeforeExpandItem

  5. DocCopyMoveEvent_InitializeCopy

  6. DocGenericEvent_InitializeNewDocument

  7. DocGenericEvent_InitializeCalculateFileName

  8. DocCopyMoveEvent_BeforeCopyWithReferences

  9. DocProjectCopyEvent_ProjectCopyExist

  10. DocCopyMoveEvent_BeforeCopy

  11. DocCopyMoveEvent_AfterCopy

  12. DocGenericEvent_BeforeNewDocument

  13. DocGenericEvent_OnProperties

  14. DocGenericEvent_AfterNewDocument

  15. DocCopyMoveEvent_AfterCopyWithReferences

  16. DocGenericEvent_TerminateCalculateFileName

  17. DocGenericEvent_TerminateNewDocument

  18. DocCopyMoveEvent_TerminateCopy

ClosedConfirm Merged with Master event sequence

  1. DocGenericEvent_PrepareCommand

  2. DocProjectCopyEvent_InitializeConfirmMerged

  3. DocProjectCopyEvent_BeforeConfirmMerged

  4. DocProjectCopyEvent_AfterConfirmMerged

  5. DocProjectCopyEvent_TerminateConfirmMerged

ClosedConfirm Superseded by Master event sequence

  1. DocGenericEvent_PrepareCommand

  2. DocProjectCopyEvent_InitializeConfirmSuperseded

  3. DocProjectCopyEvent_BeforeConfirmSuperseded

  4. DocProjectCopyEvent_AfterConfirmSuperseded

  5. DocProjectCopyEvent_TerminateConfirmSuperseded

ClosedDiscard from Project event sequence

  1. DocGenericEvent_PrepareCommand

  2. DocProjectCopyEvent_InitializeDiscardFromProject

  3. DocProjectCopyEvent_BeforeDiscardFromProject

  4. DocProjectCopyEvent_AfterDiscardFromProject

  5. DocProjectCopyEvent_TerminateDiscardFromProject

ClosedLink to Master event sequence

  1. DocGenericEvent_PrepareCommand

  2. DocProjectCopyEvent_BeforeLinkToMaster

  3. DocProjectCopyEvent_AfterLinkToMaster

ClosedRelease as Master Revision event sequence

  1. DocGenericEvent_PrepareCommand

  2. DocProjectCopyEvent_PreInitializeReleaseToMaster

  3. DocProjectCopyEvent_InitializeReleaseToMaster

  4. The following two events ONLY occur if the master document does not yet exist:

    1. DocGenericEvent_BeforeNewDocument

    2. DocGenericEvent_OnProperties

  5. The following four events ONLY occur if the master document does not yet exist AND if a parent folder has not yet been specified:

    1. ProjectWorkflowEvent_PrepareBrowser

    2. ProjectWorkflowEvent_InitializeExpandItem

    3. ProjectWorkflowEvent_BeforeExpandItem

    4. DocGenericEvent_DocumentFolderSelected

  6. DocGenericEvent_AfterNewDocument — Occurs only if the master document does not yet exist.

  7. 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:

    1. DocGenericEvent_BeforeCalculateFileName

    2. DocGenericEvent_AfterCalculateFileName

  8. DocProjectCopyEvent_PreBeforeReleaseToMaster

  9. DocProjectCopyEvent_BeforeReleaseToMaster

  10. The following two events ONLY occur if the project copy has been modified:

    1. DocProjectCopyEvent_BeforeMasterUpdate

    2. DocProjectCopyEvent_AfterMasterUpdate

  11. DocProjectCopyEvent_AfterReleaseToMaster

  12. DocProjectCopyEvent_TerminateReleaseToMaster

ClosedAfterLinkToMaster Event

Occurs when the user runs the Link to Master Document command.

Syntax

DocProjectCopyEvent_AfterLinkToMaster (Batch, MasterDoc)
Parameters
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.

ClosedAfterMasterUpdate Event

Occurs after a new revision of a master document is updated from a project copy.

Syntax

DocProjectCopyEvent_AfterMasterUpdate (Batch, ProjectCopyDoc)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

ProjectCopyDoc

An object that represents the project copy document.

ClosedAfterTransferToNext Event

Occurs when the user runs the Transfer to Next command.

Syntax

DocProjectCopyEvent_AfterTransferToNext (Batch, MasterDoc)
Parameters
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.

ClosedAfterUnlinkFromMaster Event

Occurs when the user runs the Unlink from Master Document command.

Syntax

DocProjectCopyEvent_AfterUnlinkFromMaster (Batch, MasterDoc)
Parameters
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.

ClosedBeforeLinkToMaster Event

Occurs when the user runs the Link to Master Document command.

Syntax

DocProjectCopyEvent_BeforeLinkToMaster (Batch, MasterDoc)
Parameters
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.

ClosedBeforeMasterUpdate Event

Occurs before a new revision of a master document is updated from a project copy.

Syntax

DocProjectCopyEvent_BeforeMasterUpdate (Batch, ProjectCopyDoc)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

ProjectCopyDoc

An object that represents the project copy document.

ClosedBeforeTransferToNext Event

Occurs when the user runs the Transfer to Next command.

Syntax

DocProjectCopyEvent_BeforeTransferToNext (Batch, MasterDoc)
Parameters
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.

ClosedBeforeUnlinkFromMaster Event

Occurs when the user runs the Unlink from Master Document command.

Syntax

DocProjectCopyEvent_BeforeUnlinkFromMaster (Batch, MasterDoc)
Parameters
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.

Closed*ConfirmMerged Events

Occur when the user runs the Confirm Merged with Master command.

Syntax

DocProjectCopyEvent_*ConfirmMerged (Batch, MasterDoc)
Parameters
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.

Closed*ConfirmSuperseded Events

Occur when the user runs the Confirm Superseded by Master command.

Syntax

DocProjectCopyEvent_*ConfirmSuperseded (Batch)
Parameters
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.

Closed*DiscardFromProject Events

Occur when a project copy is discarded from a project workflow.

Syntax

DocProjectCopyEvent_*DiscardFromProject (Batch)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

ClosedPreInitializeReleaseToMaster

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)
Parameters
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.

ClosedPreBeforeReleaseToMaster

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)
Parameters
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.

ClosedProjectCopyExist 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)
Parameters
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.

Closed*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)
Parameters
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.

Closed*RequireMerge Events

Occur when the user runs the Require Merge command.

Syntax

DocProjectCopyEvent_*RequireMerge(Batch, MasterDoc)
Parameters
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.

Closed*UndoMakeObsolete Events

Occur when the user runs the Undo Make Obsolete command.

Syntax

DocProjectCopyEvent_*UndoMakeObsolete (Batch, MasterDoc)
Parameters
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.

ClosedValidateTargetFolder 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)
Parameters
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.

Copy
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.

Copy
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:

Copy
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

2022 R2