AnsweredAssumed Answered

Why does this cause my instance of Sugar to crash?

Question asked by Howard Jennings on Jul 2, 2020
Latest reply on Jul 31, 2020 by Howard Jennings

The formula saves without any errors. But when I save the field I get an error that crashed my instance. It's on demand, not on my server. This is my little formula. All the fields are correct and the syntax appears to be fine too. It looks worse han it is. It's basically the same calculation with 2 main options occ or vac and 8 options p1, p2, p3 etc. 

 

ifElse(equal($policy_status_c,"Cancelled"),"0.00",
ifElse(equal($occ_status_c,"Occupied"),

ifElse(equal($bi_program_no_c,"1"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_com_occ_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_com_occ_t_c")),12)),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_res_occ_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_res_occ_t_c")),12)
)),
ifElse(equal($bi_program_no_c,"2"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_com_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_com_occ_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_res_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_res_occ_t_c")),12),$add_windstorm_cost_c)
)),
ifElse(equal($bi_program_no_c,"3"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_com_occ_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_com_occ_t_c")),12)),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_res_occ_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_res_occ_t_c")),12)
)),

ifElse(equal($bi_program_no_c,"4"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_com_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_com_occ_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_res_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_res_occ_t_c")),12),$add_windstorm_cost_c)
)),

ifElse(equal($bi_program_no_c,"5"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_com_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_com_occ_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_res_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_res_occ_t_c")),12),$add_windstorm_cost_c)
)),

ifElse(equal($bi_program_no_c,"6"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_com_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_com_occ_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_res_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_res_occ_t_c")),12),$add_windstorm_cost_c)
)),
ifElse(equal($bi_program_no_c,"7"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_com_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_com_occ_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_res_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_res_occ_t_c")),12),$add_windstorm_cost_c)
)),

ifElse(equal($bi_program_no_c,"8"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_com_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_com_occ_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_res_occ_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_res_occ_t_c")),12),$add_windstorm_cost_c)
)),

"next bit"),
)))))))
,
ifElse(equal($bi_program_no_c,"1"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_com_vac_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_com_vac_t_c")),12)),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_res_vac_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p1_res_vac_t_c")),12)
)),
ifElse(equal($bi_program_no_c,"2"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_com_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_com_vac_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_res_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p2_res_vac_t_c")),12),$add_windstorm_cost_c)
)),
ifElse(equal($bi_program_no_c,"3"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_com_vac_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_com_vac_t_c")),12)),
ifElse(equal($premium_freq_c,"Annual"),
currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_res_vac_t_c")),
divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p3_res_vac_t_c")),12)
)),

ifElse(equal($bi_program_no_c,"4"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_com_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_com_vac_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_res_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p4_res_vac_t_c")),12),$add_windstorm_cost_c)
)),

ifElse(equal($bi_program_no_c,"5"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_com_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_com_vac_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_res_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p5_res_vac_t_c")),12),$add_windstorm_cost_c)
)),

ifElse(equal($bi_program_no_c,"6"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_com_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_com_vac_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_res_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p6_res_vac_t_c")),12),$add_windstorm_cost_c)
)),

ifElse(equal($bi_program_no_c,"7"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_com_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_com_vac_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_res_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p7_res_vac_t_c")),12),$add_windstorm_cost_c)
)),

ifElse(equal($bi_program_no_c,"8"),
ifElse(equal($property_type_c,"Commercial"),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_com_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_com_vac_t_c")),12),$add_windstorm_cost_c)),
ifElse(equal($premium_freq_c,"Annual"),
add(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_res_vac_t_c")),$add_windstorm_cost_c),
add(divide(currencyMultiply($sum_insured_c,related($r_rates_bi_buildings_insurance_1,"p8_res_vac_t_c")),12),$add_windstorm_cost_c)
)),

""),

)))))))
)
)

Outcomes