04-21-2016 07:50 AM
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.
04-21-2016 11:33 AM
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.
04-21-2016 07:58 AM
If you're just changing document type of an existing document, I think you'll want to use the ReindexDocument method.
04-21-2016 08:27 AM
04-21-2016 11:33 AM
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.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.