cancel
Showing results for 
Search instead for 
Did you mean: 

Copying a revisable document to a non-revisable type

Joseph_Artuso
Confirmed Champ
Confirmed Champ

I am trying to copy a document from a revisable type to a non-revisable type using the code below:

StoreNewDocumentProperties props = app.Core.Storage.CreateStoreNewDocumentProperties(
    app.Core.DocumentTypes.Find(docType), //docType is a non-revisable doc type
    app.Core.FileTypes.Find(fileType)); //image file format

Document newDoc = app.Core.Storage.StoreNewDocument(
    app.Core.Retrieval.Image.GetDocument(docToCopy.DefaultRenditionOfLatestRevision), props); //docToCopy is a revisable document type

It appears to be creating the new document okay, but it is also throwing an error in the Diagnostics Console. The error is:

Failed to archive revision. Document type is not Revisable

And that error is bubbling up from Hyland.Core.DocumentArchiver.StoreDocumentRevision() and Hyland.Core.StorageHandler.StoreRevision(). 

I'm wondering why OnBase is trying store a revision when I'm trying to create a new document.

And also, if I'm doing something wrong or if there's a better way to accomplish this, without getting errors logged to the Diagnostic Console.

Thanks.

1 ACCEPTED ANSWER

Joseph_Artuso
Confirmed Champ
Confirmed Champ

Thanks for the feedback. I am using the original document as a template for the first page of a new document, so Reindexing isn't an option. 

However, I created new document types for my process and now it seems to be working fine now. 

View answer in original post

3 REPLIES 3

John_Anderson4
Star Collaborator
Star Collaborator

If you're just changing document type of an existing document, I think you'll want to use the ReindexDocument method.

Hi jartuso

I would definitely agree with John on this issue. It seems like storing a new Document would not be needed, and the ReindexDocument method would better suit the business needs. Would this be accurate?

If you do need to store a new Document, it might be best to work with your first line of support to troubleshoot this issue, as I would expect the above code to function.

Joseph_Artuso
Confirmed Champ
Confirmed Champ

Thanks for the feedback. I am using the original document as a template for the first page of a new document, so Reindexing isn't an option. 

However, I created new document types for my process and now it seems to be working fine now.