Back
eventPostUpdateSQL
Editing, Updating and Creating Records
eventPostUpdateSQL
Name of function to call after record is changed
Default:
The function is passed 3 parameters. The first parameter is $key, the primary key. The second is $updateok which is set to true if the record was updated correctly. The 3rd parameter is the $lens object.

Syntax
function preupdate($key, $lens)
{
GLOBAL $HTTP_POST_VARS;

$lens->connection->BeginTrans();
}


function postupdate($key, $updateok, $lens)
{
if ($updateok) {
$rs = $lens->Execute("update table set values=??? where parentid=$key");
if ($rs) $lens->connection->CommitTrans();
else $updateok= false;
}

if (!$updateok) {
$lens->connection->RollbackTrans();
}
}

$lens->eventPreUpdateSQL = 'preupdate';
$lens->eventPostUpdateSQL = 'postupdate';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]