How can I modify value in read only field.

coolek
Giga Expert

Hi,

I have one question. I have created Script Actions and in this scipt I need to modify value in field. But this field is change by Data policy (it has set Read only on "false").

If I print into the log value of this field from the script, then value is empty.

Is possible to change this value?

Thank you, so much.

7 REPLIES 7

Hi Petr,



I suspect the issue is somewhere else. GlideRecord operations don't care about dictionary entries being read-only, ACLs, or data policies.


Hello chuck,

what is the script we can use can suggest me. can you please help me

To fill all the read only fields for CI Structure – Class write a “before” business rule which runs on insert and update (to fill all the field best way is to use JavaScript in business rule)

Requirement 1:

  1. The business rule should only run if field “Table Name” changes
  2. The read only field should be filled with information from selected value in field “Table name” (you must select the referenced table entry to get the information)
  3. Field “Name” should be filled with the “label” from selected Table
  4. Field “OOTB” should be set to true if selected table is an out of the box table and to false if the selected table is not an out of the box table. (For this you can check if name value of table starts with “u_” or not)
  5. Field “Technical Name” should be filled with the “name” from selected Table
  6. Field “Parent Class” should be filled with the “super_class” from selected Table
  7. Field “Parent Class Technical” should be filled with the “super_class.name” (dotwalking) from selected Table
  8. Field “Create Date” should be filled with the “sys_created_on” from selected Table

Requirement 2:

  1. To fill all the read only fields for CI Structure – Attribute write a “before” business rule which runs on insert and update (to fill all the field best way is to use JavaScript in business rule)
  2. The business rule should only run if field “Field” changes
  3. The read only field should be filled with information from selected value in field “Field” (you must select the specific dictionary entry for field to get the information)
  4. Field “Name” should be filled with combination of Table Name.Field name (eg: u_cmdb_sap_system.description)
  5. Field “OOTB” should be set to true if selected field is an out of the box field and to false if the selected field is not an out of the box field (For this you can check if element value of dictionary starts with “u_” or not)
  6. Field “Technical Name” should be filled with the “element” from selected Dictionary
  7. Field “Type” should be filled with the “internal_type” from selected Dictionary
  8. Field “Length” should be filled with the “max_length” from selected Dictionary
  9. Field “Default” should be filled with the “default_value” from selected Dictionary
  10. Field “Inherit” should be filled with true if the field is inherited from super class and should set to false if the field is not inherited from superclass
  11. Field “Field Definition Class” should be filled with the label of class where the field is defined
  12. Field “Field Definition Class Technical” should be filled with the database name of class where the field is defined
  13. Field “Create Date” should be filled with the “sys_created_on” from selected Dictionary
  14. Field “Function Field” should be filled with the “function_field” from selected Dictionary
  15. Field “Read only” should be filled with the “read_only” from selected Dictionary
  16. Field “Mandatory” should be filled with the “mandatory” from selected Dictionary

I recommend posting this to a new thread to get more visibility and hopefully more help. I don't think I will have time in the near future to read through all this, digest it, and provide you with a solution. Sorry.