cancel
Showing results for 
Search instead for 
Did you mean: 

Copy a document within a Unity Script

Not applicable

Hi,


I currently need to re-index 15'000+ documents. My first doctype has a KW 'reference' that can have up to 12 instances . I have 12 instances of 'reference' I need to copy the file 11 times and re-index the main files and all the copies with one of the reference.

All the documents are already identified and will go through a workflow that runs a Unity script. In that script, I create a list of the instances of all the references. Then I need to copy the document currently in the Workflow and re-index the copy on one of the 'reference'.

Is there any way to duplicate / copy a document in the Unity Script ?


Any help / idea would be appreciated 🙂

1 ACCEPTED ANSWER

Adam_Kuhn
Star Collaborator
Star Collaborator

In that case, you will need to use the methods exposed by the Storage class to loop the creation of a new Document as many times as you need new documents created -- for each process, you can capture the PageData and Keywords from the originating document and apply them to the new document. There are no direct copy or duplicate methods exposed by the API.

View answer in original post

6 REPLIES 6

If you are so inclined or familiar, I would add a hybrid option. While the API can't create a direct copy, the API can call an AdHoc Task that creates a direct copy. The same task could be configured to copy all of the keywords EXCEPT the 'reference' keyword values. In the case of needing 11 copies of the original document, the API could "click" the task 11 times. Once the copies have been created, the API could propagate a single value to each of the new copies. Finally, it would have to delete all of the propagated values from the original.

In the SDK, look for "Programmers Guide" section, then "Working with Workflow", then "Workflow Ad-hoc Tasks"

That's a good call, Shane -- I'd definitely look into doing it that way, and I'll add that one to my list of cool OnBase tricks!

Getting started

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.