How to make calculated field editable

Hello,

How can we make calculated field editable.

Parents
  • In order to make calculate fields editable you need to implement a Dependency SetValue instead of a sugarLogic formula via Studio.

    In the trigger of dependency you need to evaluate whether it is empty or not, the way it will be calculated only if empty:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    $dependencies['Quotes']['data_venda'] = array(
    'hooks' => array("view", "edit"),
    'trigger' => 'equal($data_venda_c,"")',
    'triggerFields' => array(),
    'onload' => true,
    'actions' => array(
    array(
    'name' => 'SetValue',
    'params' => array(
    'target' => 'data_venda_c',
    'value' => 'now()'
    ),
    ),
    ),
    );
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • In order to make calculate fields editable you need to implement a Dependency SetValue instead of a sugarLogic formula via Studio.

    In the trigger of dependency you need to evaluate whether it is empty or not, the way it will be calculated only if empty:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    $dependencies['Quotes']['data_venda'] = array(
    'hooks' => array("view", "edit"),
    'trigger' => 'equal($data_venda_c,"")',
    'triggerFields' => array(),
    'onload' => true,
    'actions' => array(
    array(
    'name' => 'SetValue',
    'params' => array(
    'target' => 'data_venda_c',
    'value' => 'now()'
    ),
    ),
    ),
    );
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children
No Data