Field Dictionary - Calculated Field

Juan Lopez Pola
Tera Contributor

Why does a field that is intended to be editable, when I selected calculated field to true, sets the property to readonly?

 

Please help.

1 ACCEPTED SOLUTION

Ashir Waheed
Kilo Sage

Hi @Juan Lopez Pola 

 

When you set the "Calculated" field to "True" in ServiceNow, it means that the value of the field will be calculated based on a formula(script) that you define. Once you define a formula(script) for a calculated field, the system automatically makes the field read-only to prevent manual changes to the field value that might conflict with the formula(script).

This behavior is by design to ensure the accuracy of calculated values. If the calculated field were editable, it could be modified in a way that doesn't align with the formula, leading to inaccurate results. Thus, to maintain the integrity of the calculated field, the system automatically sets the field as read-only.

If you need to modify the value of a calculated field, you'll need to adjust the formula that calculates the value. Alternatively, you can create a separate field that is not calculated and set it as editable for manual changes. In some case you can also use Business Rule instead of this.

 

Regards,

Ashir Waheed

 

 

View solution in original post

1 REPLY 1

Ashir Waheed
Kilo Sage

Hi @Juan Lopez Pola 

 

When you set the "Calculated" field to "True" in ServiceNow, it means that the value of the field will be calculated based on a formula(script) that you define. Once you define a formula(script) for a calculated field, the system automatically makes the field read-only to prevent manual changes to the field value that might conflict with the formula(script).

This behavior is by design to ensure the accuracy of calculated values. If the calculated field were editable, it could be modified in a way that doesn't align with the formula, leading to inaccurate results. Thus, to maintain the integrity of the calculated field, the system automatically sets the field as read-only.

If you need to modify the value of a calculated field, you'll need to adjust the formula that calculates the value. Alternatively, you can create a separate field that is not calculated and set it as editable for manual changes. In some case you can also use Business Rule instead of this.

 

Regards,

Ashir Waheed