Service Duration field name for formula?

Hello, 

I have a custom formula in SugarCRM that calculates New Annual Recurring Revenue:

ifElse( 

equal($arr_yes_no_c,"Yes") 

,ifElse( 

equal($product_type,"Renewal") 

,0 

,ifElse( 

equal($product_type,"Renewal_with_upsell") 

,subtract($discount_price,$renewal_arr_c) 

,ifElse( 

greaterThan(subtract($discount_price,$renewal_arr_c),0) 

,subtract($discount_price,$renewal_arr_c) 

,0 

) 

) 

) 

,0 

) 

I would like to modify, to add another condition. However, this condition includes Service Duration Unit - I cannot find a field name for it, do you know where can I find the Field Name (not Display Label) for it? 

Parents
  • The fields $service_duration_value and $service_duration_unit have no explicit vardef definition.

    If you create a small patch file e.g. in custom/Extension/modules/RevenueLineItems/Ext/Vardefs/service_duration_patch.php with the following content:

    <?php
    $dictionary["RevenueLineItem"]["fields"]["service_duration_unit"]["studio"] = true;
    $dictionary["RevenueLineItem"]["fields"]["service_duration_value"]["studio"] = true;

    then you will have both fields in Studio to be used as calcuation fields.

Reply
  • The fields $service_duration_value and $service_duration_unit have no explicit vardef definition.

    If you create a small patch file e.g. in custom/Extension/modules/RevenueLineItems/Ext/Vardefs/service_duration_patch.php with the following content:

    <?php
    $dictionary["RevenueLineItem"]["fields"]["service_duration_unit"]["studio"] = true;
    $dictionary["RevenueLineItem"]["fields"]["service_duration_value"]["studio"] = true;

    then you will have both fields in Studio to be used as calcuation fields.

Children
No Data