Hi,
I am using a grid update event.
I want to check the sum of "gewichtung", which is column of details.
The function should check sum of gewichtung for the given record of master table, if the total is greater then 1..
But It does not work.
Any idea?
My records in gewichtung are: 0,1, 0,1, 0.4, and so on.
// Grid Updating event
function Grid_Updating($rsnew)
{
$rsnew = $this->getGridFormValues(); // Get the form values of the new records as an array of array
$newtotal = 0;
foreach ($rsnew as $row) // Loop through the new records
$newtotal += intval($row["gewichtung"]);
if ($newtotal < 1)
{
// To cancel, set return value to False
$this->setFailureMessage("The new total must be larger than the old total.");
return false;
}
return true;
}
mpol_ch