Is it possible to overwrite calculated fields?

Hi, 

I am wondering - is it possible to overwrite calculated fields? 

I have a calculated field (Total Contract Value) which is calculated based on ARR and subscription duration. But there are some exceptions to the formula. Rather than altering the formula, is it possible to edit the field, so that I can overwrite the calculated value and input it manually?

Thanks!

Ada

Parents
  • Hi ,

    The solution proposed by is, from my perspective, the recommended path to ensure entered data is retained. There is one alternative that has some more destructive qualities that may be acceptable or even desirable depending on your use case. When creating a calculated field in Studio, a file is created with the calculation properties at:

    ./custom/Extension/modules/{module_name}/Ext/Vardefs/sugarfield_{field_name}.php

    In that file, there is a parameter:

    $dictionary['Opportunity']['fields']['{field_name}']['enforced']='1';

    If you change that value to 0 and then perform a quick repair, the field will have the following qualities:

    1. It is no longer read-only. It can be edited at any time.
    2. The calculation will trigger as you have it defined
    3. A user can overwrite the calculated value
    4. If any of the dependencies in the fields calculation are updated after a user-entered value is saved, the calculation will re-trigger and overwrite the user-entered value

    Chris

Reply
  • Hi ,

    The solution proposed by is, from my perspective, the recommended path to ensure entered data is retained. There is one alternative that has some more destructive qualities that may be acceptable or even desirable depending on your use case. When creating a calculated field in Studio, a file is created with the calculation properties at:

    ./custom/Extension/modules/{module_name}/Ext/Vardefs/sugarfield_{field_name}.php

    In that file, there is a parameter:

    $dictionary['Opportunity']['fields']['{field_name}']['enforced']='1';

    If you change that value to 0 and then perform a quick repair, the field will have the following qualities:

    1. It is no longer read-only. It can be edited at any time.
    2. The calculation will trigger as you have it defined
    3. A user can overwrite the calculated value
    4. If any of the dependencies in the fields calculation are updated after a user-entered value is saved, the calculation will re-trigger and overwrite the user-entered value

    Chris

Children
No Data