Skip to main content
Mavens Knowledge Base

Document clone framework

Overview

Using the Clone Document feature, authors can start a clone of a document, choose which related data to bring along (Collaborators, Studies, Objectives, and Targets) in the same clone wizard through a background pipeline. They can follow live progress until the cloning finishes.

Clone Document action in the document actions menu on a document record page

  1. Open a Document record and in the drop-down menu, click Clone Document.

    Clone Document action in the document actions menu on a document record page

  2. Work through the three steps by adding the relevant details and clicking Next.

    First step of the Clone Document wizard, showing file hosting and document detail fields

  3. In the last step, choose what to copy out of the following:

    Final step of the Clone Document wizard, with checkboxes for Collaborators, Study Documents, Publication Objectives, and Targets

    • Collaborators: Copies each Document Collaborator (mvn__PP_Document_Author__c) record, along with the roles and assignments defined in the clone field set. The source document's Owner (CM_Owner) role is skipped — the user who runs the clone becomes the new document's owner.

      info

      If the original document is cloned by the owner of the document, then all of the related Document Collaborator records on the source Document record will also appear in the Document Collaborators component on the cloned Document record. However, if the original document is cloned by a user who is not the owner, all of the document collaborators from the original document will also appear on the cloned document except for the owner, even if they have other roles in addition to the Owner role. This is because each document can only have one Owner, and the user who clones the document becomes the Owner of the newly created document.

    • Studies: Links the clone to the same studies by copying its Study Document (mvn__PP_Study_Document__c) records. The underlying Master Study records are never duplicated.

    • Objectives: Copies every Publication Objective (mvn__PP_Publication_Objective__c) record linked to the source document.

    • Targets: Copies each Target (mvn__PP_Target__c) record and stamps Cloned From (mvn__PP_Cloned_From__c) on the new record to preserve lineage.

    Clearing every checkbox produces a document-only clone with no related records copied.

    important

    The checkboxes which are shown selected depend upon the administrator's configuration on the Document Clone Feature Activation record. See step 3 in Enable and Configure.

    note

    Two things stay outside the framework:

    • Submissions are never cloned.
    • Milestones keep their existing behavior — the product creates them automatically where applicable, and the framework never copies them as related records.
  4. Click Save. The cloning process starts.

    Clone Progress dialog showing overall status Running with per-object progress for Document, Collaborators, Targets, Study Documents, and Publication Objectives

  5. After Save.

    • On success: The author lands on the new cloned document.

      New cloned document record with a "Your document has been successfully created" success message

    • On failure: The incomplete clone is deleted and the author returns to the source document, ready to retry.

info

Re-running a clone against the same source document does not duplicate related records; the pipeline skips any source row whose deduplication key already exists on the clone.

Enable and configure

The framework is disabled by default and to enable it, follow the below steps:

1. Activate the Document Clone Feature Activation record

  1. In SetupCustom Metadata Types navigate to Feature Activation (mvn__Feature_Activation__mdt) and click Manage Records.

    Feature Activation row highlighted in the Custom Metadata Types list in Setup

  2. Open the Document Clone (Document_Clone) record, or create it.

    Document Clone record highlighted in the Feature Settings list of Feature Activation records

  3. Configure the following:

    Feature Activation Edit page for the Document Clone record with the Active checkbox and Long Value field highlighted

    • Set Active (mvn__Active__c) to true.

    • Populate Long Value (mvn__FA_Long_Value__c) with JSON. The unpackaged defaults are:

      {
      "additionalStepLwcName": "mvn/ppCloneRelatedSelectionStep",
      "collaboratorCloneFieldSetName": "mvn__PP_Document_Author_Clone_Fields",
      "preselectCollaborators": true,
      "preselectStudyDocuments": true,
      "preselectPublicationObjectives": true,
      "preselectTargets": true
      }
      JSON keyPurpose
      additionalStepLwcNameThe Lightning Web Component that renders the Related objects step — for example, c/ppCloneRelatedSelectionStep.
      collaboratorCloneFieldSetNameThe collaborator field set to use when Pubs Global Setting does not override it.
      preselectCollaboratorsWhether Collaborators stay selected.
      preselectStudyDocumentsWhether Studies stay selected.
      preselectPublicationObjectivesWhether Objectives stay selected.
      preselectTargetsWhether Targets stay selected.

2. Confirm the field sets

Field sets determine which fields are carried onto the new child records. Each set must exist and contain only fields that users can read on the source record and create on the new one.

Related recordObjectDefault field set API nameWhere to configure
CollaboratorsDocument Collaborator (mvn__PP_Document_Author__c)mvn__PP_Document_Author_Clone_FieldsFeature Activation custom metadata type
StudiesStudy Document (mvn__PP_Study_Document__c)mvn__PP_Clone_FieldsEdit the field set in Setup
ObjectivesPublication Objective (mvn__PP_Publication_Objective__c)mvn__PP_Clone_FieldsEdit the field set in Setup
TargetsTarget (mvn__PP_Target__c)mvn__PP_Clone_FieldsEdit the field set in Setup