Question
How to set the Batch registration parameter's value?
Answer
If you want to set the Registration parameter value of the Batch, the Properties should be used.
To set the Batch registration parameter, please use the Set (name: string, value: string) method on the Properties object of the Batch.
For example, the “my value” can be set as a value for the “RegParam” parameter using the following code:
Batch.Properties.Set("RegParam", "my value");
Comments
2 comments
Esteban Sansur
Hello,
I need to assign a value to a batch registration parameter from a rule script running within a field by using the line "this.Document.Batch.Properties.Set("SourceFile", this.Field("SourcePDF").Text);" I'm getting the error message "a read only file cannot be modified"
Any though?
Esteban Sansur
I have managed this by using a stage batch script like this:
pdfsource = this.Documents.Item(0).Field("DOCNAME\\PDFOrigen").Text;
this.Properties.Set("PDFOrigen", pdfsource);
In this case is useful since the whole batch is compound by a single PDF file that contains multiple documents inside, so the first document always there contains the document source filename field used to be assigned to the batch registration parameter, so I can use it as a column when looking the batch list view.
From a document script rule cannot be edited a property outside of the document itself (the batch)
Please sign in to leave a comment.