Re: 0 duclipate numeric
Reply #2 –
Without removing the index, achieve this by modifying the controllers. But when specifying again it makes them original, I suppose I will have to make it custum. But I leave my temporary solution in case someone wants to improve it ...
SharedController.php
/**
* persona_per_docnro_value_exist Model Action
* @return array
*/
function persona_per_docnro_value_exist($val){
$db = $this->GetModel();
$exist=false;
if ($val > 0) {
$db->where('per_docnro', $val);
$exist = $db->has('persona');
}
return $exist;
}
PersonaController.php
//Check if Duplicate Record Already Exit In The Database
//if(isset($modeldata['per_docnro'])){
if (isset($modeldata['per_docnro']) and ($modeldata['per_docnro'] > 0 ) ){
$db->where('per_docnro',$modeldata['per_docnro'])->where('perid',$rec_id,'!=');
if($db->has($tablename)){
$this->view->page_error[] = $modeldata['per_docnro']." ¡Ya existe!";
}
}