when I Add a new record in this situation:
I want to load previous values ad default, so I added this code in Process record values:
$matricola = $values["matricola"];
$queryIngresso = "SELECT ingresso FROM rettifiche WHERE matricolarett = '$matricola' ORDER BY idrett DESC LIMIT 1";
$resultIngresso = CustomQuery($queryIngresso);
$values["ingresso"]=db_fetch_array($resultIngresso);
I don't have any results so I think is not correct to read matricola $values["matricola"]
Do you have another solution?