cancel
Showing results for 
Search instead for 
Did you mean: 

Keywords can only be modified on an active document

Wesley_Walker
Confirmed Champ
Confirmed Champ

We have an IWorkflowScript that throws this error when executing:

An error occurred within the Unity API: Keywords can only be modified on an active document.

I'm banging my head on my desk trying to figure out what is causing this to occur.

Any ideas?

Thanks!

Wes

1 ACCEPTED ANSWER

David_Caballero
Champ on-the-rise
Champ on-the-rise

Sorry...I don't see the same issues that my coworker had.  One question though.  If this is an iWorkflow script, why are you trying to get all the documents in the queue into a collection?  iWorkflow scripts will run once for every document in the queue.  All you have to do is work with the one document that gets passed to you in the args.  I'm just a little confused in trying to understand your approach.

View answer in original post

4 REPLIES 4

David_Caballero
Champ on-the-rise
Champ on-the-rise

Can you share some your code?  This sounds similar to an issue that one of my coworkers had a few weeks ago.  It was due to a timing issue.  We were able to fix it by rearranging the code.

One more question, is this on a new document?

David_Caballero
Champ on-the-rise
Champ on-the-rise

Sorry...I don't see the same issues that my coworker had.  One question though.  If this is an iWorkflow script, why are you trying to get all the documents in the queue into a collection?  iWorkflow scripts will run once for every document in the queue.  All you have to do is work with the one document that gets passed to you in the args.  I'm just a little confused in trying to understand your approach.

Can I ask a follow up Question:

 

I am using an iScheduleable script to loop through a result doclist from a Custom Query.

 

     foreach( Document doc in docList){
           DocumentLock docLock = doc.LockDocument();

         ...

        keyModifier.ApplyChanges();  -- Its failing here with that same Error Message.

Nevin_Steindam
Star Contributor
Star Contributor

If a document is in a scan queue in an UNINDEXED state, you'll get this error. OnBase is very insistent that documents aren't "real documents" until the initial indexing is done: You wouldn't want them to show up in a general query, for example, until a user has said for sure what it's document type and keywords are.

This can be frustrating at times. Until it's indexed, neither the API nor Workflow can do very much - you can't even transition the document to a new queue!

If you're doing something to move documents from a scan queue, to Workflow, then back to a scan queue, then you can run into this error. Even if the documents were indexed before, they will be considered unindexed again until they get through the Index step of their new batch.

(And if there is a Reindex step, they need to get through that as well.)