ImpAKT Forum :: custom before trigger - unique per user
This thread was displayed: 0 times
Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.
For more information about the affected products visit: www.interaktonline.com/Support/
B F
08-20-2007 06:34:37 GMT +2
|
For anyone who needs a custom trigger to check column values for uniqueness (all column values only PER USER) here it is:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//start Trigger_Custom1 trigger
function Trigger_Custom1(&$tNG) {
$q = "SELECT * from LC WHERE LC.LC_fkMid = " . $_SESSION['kt_login_id'] . " AND LC.LCName = '" . $tNG->getColumnValue("LCName") ."'";
$rs = $tNG->connection->Execute($q) or die($tNG->connection->ErrorMsg());
$totalRows_rs = $rs->RecordCount();
if ($totalRows_rs > 0){
$myThrowError = new tNG_ThrowError($tNG);
$myThrowError->setErrorMsg("server_error");
$myThrowError->setField("LCName");
$myThrowError->setFieldErrorMsg("please choose another name. you already have this name");
return $myThrowError->Execute();
}
}
//end Trigger_Custom1 trigger
|
|
|