I am using a calculated field in a form (Data Type = Single Line of Text), however I would like to make this field editable for a specific users having "System Administrator" roles.

I tried using the field security profile to make this field editable (so that System Admin can update or create records here) however update/create options are disabled here in security profile and cannot be altered.

Is there an appropriate way to achieve this? Can we make a calculated field editable for specific set of roles?

2

There are 2 answers

0
Nicknow On

The calculated field is calculated in SQL when you retrieve it, but is not stored in field.

So, for a calculated field there IS NOT a place to store a value. This makes it impossible to have the same field be calculated in some cases and manual in other cases.

You would need to have two fields the calculated fields and an override field. In the calculated field you set a condition that if the override field contains data the action is to set the calculated field equal to the override field. The else has an action to calculate the field as your normally.

Here is an example where I created a field testca(`new_testca') that will if the Account Number is populated use that value and if not its value will be some text I entered, "NEED ACCOUNT NUMBER".

enter image description here

2
Henrik H On

No, you cannot directly edit the value of a calculated field.

A work-around would be to create a separate field, where only specific users can enter data. In your calculated field you could then add a condition to take either the manually entered value from the other field (if it exists) and otherwise use the original action for the calculated field.