I am trying to run a C# script which takes a substring from one field (text matched to regular expression) and writes its content to another field.
The problem is that when I run test in Script Editor window an error message pops up which says:
System.Runtime.InteropServices.COMException (0x80004005): Unable to modify a read-only field 'ContractorOKPO'. at ABBYY.FlexiCapture.IField.IField.set_Text(String _result).
Does it mean that there is no way manipulating Fields values with scripts at a Document Definition level?
There is confusion about stated error as documentation says that Text property of IField type is nor READ-ONLY
This is the script I am trying to run:
IField dataField, OKPOField;
OKPOField = Context.Field("ContractorOKPO");
dataField = Context.Field("ContractorData");
extractedData = dataField.Text;
OKPOField.Text = extractedData;
Would be happy to hear suggestions from anyone around.