Can't understand Data Policy Exception: The following fields are read only: Class

vanessaheux
Tera Contributor

Hello


I have changed my formular for computers in CMDB in order to get the most important fields first.

I have created one data policy on table cmdb_ci_computer to have some fields mandatory and to have the field “Class” read-only (as it is auto filled when creating a computer).

When I create a new computer, I fill all mandatory fields (class is filled by default) I get an error message

"Data Policy Exception: The following fields are read only: Class"

 

Having the field Class read only was exactly what I expected from the system (as per defined in my data policy) but why does the system does not let me create the new computer?

What kind of object does not let me store this computer?

 

Regards

Vanessa

1 ACCEPTED SOLUTION

p_kanczugowski
Tera Guru

Hi Vanessa!

The idea behind read-only data policies is exactly that: restricting write access based on the conditions you set. So, if there you set no conditions whatsoever, then you won't be able to write to sys_class_name, unless you explicitly force it with a script.

Whenever you create a new record, what is does is system writes to that field as well, hence the error. Class is a system column that's normally not placed on the form, why do you need it there?

What you can do is create an equivalent ACL and give role-based access. Or, if all you need is client-side restriction, you can just go ahead and use a UI policy.

Please mark this response as correct/helpful if this is what you've been looking for!

View solution in original post

1 REPLY 1

p_kanczugowski
Tera Guru

Hi Vanessa!

The idea behind read-only data policies is exactly that: restricting write access based on the conditions you set. So, if there you set no conditions whatsoever, then you won't be able to write to sys_class_name, unless you explicitly force it with a script.

Whenever you create a new record, what is does is system writes to that field as well, hence the error. Class is a system column that's normally not placed on the form, why do you need it there?

What you can do is create an equivalent ACL and give role-based access. Or, if all you need is client-side restriction, you can just go ahead and use a UI policy.

Please mark this response as correct/helpful if this is what you've been looking for!