Hello.
In earlier versions of PHPRunner I had to validate if some data already existed in the table(before record add - event). If duplicate records existed then the form dont save the data and sent an alert by email. Duplicate records were saved if a condition was satisfied in a field in a table (table.field_allowSaveDuplicateRecords = yes)
Example code:
//event before record add
$checkDuplicate = "select * from table where field = "'.$values["field"].'"";
$rsCheck = db_query($checkDuplicate,$conn);
$duplicateData=db_fetch_array($rsCheck);
if($duplicateData){
....send email alert
//check if the duplicate data is allow to save in the table
$checkCondition = "select field_allowSaveDuplicateRecords from table where field = "'.$values["field"].'"";
$rsCheckCondition = db_query($checkCondition,$conn);
$condition=db_fetch_array($rsCheck);
if($condition["field_allowSaveDuplicateRecords"] == "yes"){
return true;
}
else{
return false;
}
}
In PHPRunner 8 the feature "prevent duplicate data" is very interesting. But is possible remove that validation based on a condition like i described previously ?