Setting the value of a document field through Custom workflow stage

  • 792 Views
  • Last Post 23 April 2018
PhinkTad posted this 16 April 2018

Hello,

Let's say I have a field in my document definition called myField

 

After recognition, I have a custom stage -document script with the following line, I use a checkbox field to send the document to this stage. The document enters the stage, but there seems to be a problem in updating the value of myField.


   Document.Field("Invoice Layout\\myField").Text ="Yes";

I get the below error from processing server.

Strange thing is, I have a similar script which works fine on a different project.
What am I doing wrong?

-1 1 4/16/2018 63:41 PM Document 1: System.Runtime.InteropServices.COMException (0x80004005): This operation is not allowed.    at ABBYY.FlexiCapture.IField.set_Text(String _result)    at Main.Execute(IDocument Document, IProcessingCallback Processing)

Please help!

Order By: Standard | Newest | Votes
Rahul posted this 23 April 2018

Hi PhinkTad,

Did you try using property '.Value' instead of '.Text' ?
I am using Flexicapture 11 and as per my observation if you want to set the value of Checkbox then you should have to use property '.Value' as follows:
Document.Field("Invoice Layout\\myField").Value = true;

So if you want to set the value then assign true or false to '.Value' property and if you want to access the value then access by property '.Text' and output will be "Yes" or "No".
Let me know if it helps.

-Rahul

PhinkTad posted this 23 April 2018

That solves it, Thank you so much !
By the way, do you think you can answer this one?:

I have multiple documents in a batch. I was wondering if there is a way to export only one document out of the batch quickly if needed? 

Currently, I have to wait for all the documents to be verified and then export the batch.

I'm using the odbc database export.

Thanks!



Close