When I wrote the code below for the before-record=added/updated events, the first added value of the "Nb_s" (btw, it's 7), is being saved for all the subsequent records as if it was default value. The original value is overwritten. What's the hell it should mean?
When I clear the event, everything returns to the normal... If I put the code, all the "Nb_s" values after saving become 7.
if ($values["Nb_s"]=3 or $values["Nb_s"]=4)
$values["Nb_s_LI"]=1;
if ($values["Nb_stools"]=5 or $values["Nb_s"]=6)
$values["Nb_s_LI"]=2;
if ($values["Nb_stools"]=7 or $values["Nb_s"]=8 or $values["Nb_s"]=9)
$values["Nb_s_LI"]=3;
if ($values["Nb_s"]>=10)
$values["Nb_s_LI"]=4;
else
$values["Nb_s_LI"]=0;
return true;