This topic is locked

Calculation ?

9/9/2009 3:42:55 AM
PHPRunner General questions
N
netmedia59 author

Hello,
I have a field called "Categ" containing for example "301;303" (result of a multiple checkbox)

I want to write 301 in aanother field called AuthPerso

I want to write 0 in aanother field called AuthPro (because there is no "302" in the "Categ" field)

I want to write 303 in aanother field called AuthDistrib
How can I managed this in an Edit fonction certainly in the Event Before Record Updated, but ???
Thanks
Olivier

Lille (FRANCE)

D
danaci 9/9/2009

after add or after edit event code

$value["result"]=$value["yourfield1"] (+ - / expression) $values["yourfield2"];
$values["anotherfield"]=$values["result"]+-
/ $values["anotherfield"];

N
netmedia59 author 9/9/2009

Hello,
Thanks for your help

In fact, I found the clue and here what I wrote :
Thanks again

Olivier
if (preg_match("#301#", ($values["Categ"]))

)

{

$values["AuthPerso"] = 301;

}

else

{

$values["AuthPerso"] = 0;

}
if (preg_match("#302#", ($values["Categ"]))

)

{

$values["AuthPro"] = 302;

}

else

{

$values["AuthPro"] = 0;

}