Hi,
I'm beginning my journey on SugarCRM and I am quite struggling to make a formula for my calculated field using the Ifelse argument, the condition is in a different module, and makes it quite hard to make it work for me here is my code at the moment :
ifElse(
equal(
related($sa001_socleaffaire_opportunities_1,"lot_c"),"Lot 1"),
subtract($montant_1_c,add($prelevements_1_c,$prelevement_2_c,$prelevement_3_c,$com_commerciale_c,$markup_3_c)),
subtract($montant_1_c,add($prelevements_1_c,$prelevement_2_c,$prelevement_3_c,$com_commerciale_c)))
The goal of that code is that : if '"lot_c" is equal to "Lot 1" then the subtraction needs to be
Montant_1_c - (prelevements_1_c + prelevement_2_c +prelevement_3_c+com_commerciale_c+markup_3_c)
Else
Montant_1_c - (prelevements_1_c + prelevement_2"_c +prelevement_3_c+com_commerciale_c)
My problem here is that the "lot_c" identification doesn't work and sugar react as if it was always "Lot 1",
there is one thing to know, the "lot_c" key is dropdown list and "Lot 1" is one of the possible key of my dropdown list
If you guys see a problem within my code I'll take any feedback possible :)
Arthurs