AnsweredAssumed Answered

SugarCrm 7.9: Quote Line Items Formula [related()] not working onChange

Question asked by Aravind Kumar on Feb 26, 2018
Latest reply on Feb 26, 2018 by Offshore Evolution

I have a field in Product module (Quote Line Items), the field has formula to calculate when there is a value in other fields. 


When i test in Product module its working fine. But when i use the field in Quote Line item its not working only on Saving the particular line item it is reflecting. Do we need to add anything additionally in quote-data-group-list.php


My Field:

$dictionary['Product']['fields']['revenue_c'] = array(
    'audited' => true,
    'calculated' => true,
    'formula' => '
            greaterThan($list_price, 0),
                multiply($list_price, $quantity),
            multiply($product_cost_c, $quantity)
    'name' => 'revenue_c',
    'readonly' => true,
    'reportable' => true,
    'enforced' => true,
    'required' => false,
    'source' => 'custom_fields',
    'type' => 'currency',
    'vname' => 'LBL_REVENUE',



is a calculation field which has related() field from other module.


In My quote-data-group-list.php

    'name' => 'revenue_c',
    'label' => 'LBL_REVENUE',
    'type' => 'currency',
    'convertToBase' => true,
    'showTransactionalAmount' => true,
    'related_fields' => array(

Questions: What additional configuration we need to use to make the formula work in Quote Line Items Onchange?



If you see the above image the value is calculated only after saving the line item, But in Product module we can able to get value before saving the product, So in order to make the formula work as like in product module, What config changes we need to do in quote-data-group-list.php