cancel
Showing results for 
Search instead for 
Did you mean: 

Is the new document's ID available in a Document Composition script?

Bill_Wadlingto2
Confirmed Champ
Confirmed Champ

When a document is composed from a WorkView Object, I'd like to attach the resulting document to the WorkView Object's static folder.  I've written a script to do so that is executed as part of the template, but I'm thinking the script is being run before the document ID exists.  Can someone validate that or point me in the right direction on accessing the new document's ID?

1 ACCEPTED ANSWER

David_Coxe1
Star Contributor
Star Contributor

Bill,

   You are correct that the Document ID hasn't been assigned prior to the script running.  The document id is assigned when the template is archived.  Therefore, your script will not have an id to run against.

A possible alternative is to send the document into a Workflow and run your script there.

 

I hope that helps.

View answer in original post

2 REPLIES 2

David_Coxe1
Star Contributor
Star Contributor

Bill,

   You are correct that the Document ID hasn't been assigned prior to the script running.  The document id is assigned when the template is archived.  Therefore, your script will not have an id to run against.

A possible alternative is to send the document into a Workflow and run your script there.

 

I hope that helps.

Thanks David - I am using a Workflow to create the document through a Compose Document action, (which isn't working, but that's a story for another post). My original plan was to run a script from the Workflow to link the two together, but I thought I'd see what my options where from the DocComp scripting angle. So back to plan A!