Bug 5.75: Read Only field not touched by hook _before_insert
Posted: 2019-06-13 07:10
Hi,
I need to have a field that is calculated by code from other fields of the record (yes, I know, do not save such things in the database, but AG makes it difficult to work with a database-clean-consciousness).
So I set the field in AG to be read only. The field id displayed in the generated application - but can not be changed.
I created a hook (_before-insert) that should fill that field of a new (and from changed) records. This does NOT work.
When I change the setting in AG and remove the read only flag, of course, I can change the value in the web - but now my hook code works as expected.
The same happens, when the field in AG is not readonly but hidden (hide in table/detail view) -> hook does not fill the field
I think this is a bug. The hook should work for all fields and not depend if a field if read only in AG (or not shown to the user).
Olaf
I need to have a field that is calculated by code from other fields of the record (yes, I know, do not save such things in the database, but AG makes it difficult to work with a database-clean-consciousness).
So I set the field in AG to be read only. The field id displayed in the generated application - but can not be changed.
I created a hook (_before-insert) that should fill that field of a new (and from changed) records. This does NOT work.
When I change the setting in AG and remove the read only flag, of course, I can change the value in the web - but now my hook code works as expected.
The same happens, when the field in AG is not readonly but hidden (hide in table/detail view) -> hook does not fill the field
I think this is a bug. The hook should work for all fields and not depend if a field if read only in AG (or not shown to the user).
Olaf