Kofax TotalAgility - UpdateFolderFieldValue() throws the error "Object is read only. You need to lock the object to change its properties"
Applies to
- Kofax TotalAgility 7.5
- Kofax TotalAgility 7.6
- Kofax TotalAgility 7.7
Issue
When calling the UpdateFolderFieldValue() method in a parent/child folder structure, the below exception occurs
Object is read only. You need to lock the object to change its properties
Cause
When a folder field is defined in the parent folder, it is inherited by all child folders. In the screen shot below the field ParentField is inherited by the folder type Child Folder
The error occurs when we call UpdateFolderFieldValue() while passing a child folder id and an inherited parent. We can only call UpdateFolderFieldValue() for a child folder for fields defined in the child folder e.g. ChildField