You are viewing limited content. For full access, please sign in.

Question

Question

Copy document and retain version history

asked on April 12, 2022

Hi All,

 

Is there a way to copy a word document and retain the versions as part of the new copy? Seems if I have a source document that has 5 versions, if I copy and paste that document it just creates a new document with a single version, I'd also like to copy the versions as part of the document/file copy.

 

I can't see any obvious settings in Tools>Options, is this possible natively?

 

Cheers!

Chris Douglas

0 0

Answer

SELECTED ANSWER
replied on April 13, 2022

LF Support have confirmed this is expected behaviour.

0 0

Replies

replied on April 13, 2022

Please can I raise this as a feature request, that when copying documents, the versions are also copied with the document. This is what I'd expect to happen.

 

Cheers!

0 0
replied on April 14, 2022 Show version history

I'll add it to the list. The behavior is on purpose because some customers liked to collaborate on a document until it was ready for "public" consumption. At that point they make a "clean" copy that is sent out.

As a workaround, exporting the document as a briefcase and importing it back in will result in a copy of the document with all its versions.

0 0
replied on April 15, 2022

Briefcases include version histories by default, so this can be accomplished by exporting as a briefcase and re-importing. Make sure version histories are enabled in the briefcase export options:

0 0
replied on April 18, 2022

Thanks Robert,

 

Is there any way to achieve this with workflow? I've tried the replicate entries activity, but that doesn't seem to do the trick?

0 0
replied on April 18, 2022

Use a script activity to export the entry as a briefcase to a temporary file, then import the briefcase:

string tempPath = Path.GetTempFileName();

try
{
    using (BriefcaseExporter briefcaseExporter = new BriefcaseExporter(session))
    {
        briefcaseExporter.BriefcaseName = "briefcase.lfb";
        briefcaseExporter.IncludeVersionHistory = true;
        briefcaseExporter.AddEntry(docId);
        briefcaseExporter.Export(tempPath);
    }

    using (BriefcaseImporter importer = new BriefcaseImporter(session))
    {
        importer.DestinationFolder = Folder.GetFolderInfo(@"\DestinationFolder", session);
        importer.OnDocumentConflict = DocumentConflictStrategy.MakeUnique;

        importer.Import(tempPath);
        Exception ex = importer.GetLastException();
        if (ex != null)
            throw ex;
    }
}
finally
{
    // Cleanup temp file
    File.Delete(tempPath);
}

 

1 0
replied on April 19, 2022

Did you check "include version history" in the "copy settings" dialog in Replicate Entries?

1 0
replied on April 20, 2022

Thanks Miruna, this does replicate the entry with the version history (although it does create a new mystery version for some reason). 

The last bit I'm struggling with is how to get to the metadata of the replicated entry, as I need to tidy up the meta data for the multi value field (to only include the current 'for each value' loop) and to clear the other values in the multi value field.

 

I can only seem to interact with folders, not the copied entry itself?

 

 

In a move entry activity I get options for the entry itself:-

 

 

Any ideas?

0 0
replied on April 20, 2022

That is correct. Since a briefcase can contains (hundreds of) thousands of entries, Workflow does not provide all entries created to the instance in order to maintain reasonable performance. You can trigger another workflow off the document creation in the destination folder.

0 0
replied on April 21, 2022

Thanks Miruna, I don't think triggering another workflow would help as you wouldn't know which one of the multi value fields you had to keep. I'll explore the SDK route further. 

0 0
replied on April 21, 2022

My esteemed colleague figured it out:-

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.