AnsweredAssumed Answered

Custom dependency formula doesn't works while adding Opportunity Line item

Question asked by Venkatesh Babu on Mar 5, 2018
Latest reply on Mar 5, 2018 by Venkatesh Babu

Hi,

 

Custom dependency formula display's a negative value in record view while Adding an Opportunity line item but upon refreshing the page the actual value is displayed correctly.

 

My vardef looks like

 

$dictionary['Opportunity']['fields']['opportunity_field'] = array(
    'audited'    => true,
    'calculated' => true,
    'enforced'   => true,
    'comments'   => '',
    'formula'    => '
        ifElse(
            greaterThan($actual_amount, 0),
            multiply(
                divide(
                    subtract(
                        $actual_amount,
                        rollupSum($lineitem, "total")
                    ),
                    $actual_amount
                ),
                100
            ),
            0
        )
    ',
    'name'       => 'opportunity_field',
    'readonly'   => true,
    'reportable' => true,
    'required'   => false,
    'source'     => 'custom_fields',
    'type'       => 'decimal',
    'precision'  => 2,
);

Thanks for the help and please let me know if more information is required.

 

Thanks,

Venkatesh

Outcomes