This topic is locked

Total in 3rd field

10/31/2006 7:14:29 AM
PHPRunner General questions
M
mmponline author

I have 3 fields:

QTY

Value

Total
what expression or event do I use to add the total of QTY x Value in the Total field.
Thanks for help.
Stephan

J
Jane 10/31/2006

Stephan,
you can do it using BeforeAdd or BeforeEdit event.

Here is a sample code:

function BeforeAdd(&$values)

{

$values["Total"] = $values["QTY"]*$values["Value"];

return true;

}

M
mmponline author 10/31/2006

Thanks Jane
Works great. Will also help for other possible formulas.