[SOLVED]lookup in grid application don't work after the last update !!

lookup in ADDED fields dont’t work !!!
I think that is because lookup is fired before the Onrecord event is fired and the ADDED fields have null values in these moment.
I fill the added fields in the Onrecord event.

Error
Se produjo un error al acceder a la base de datos
[Microsoft][Controlador ODBC Microsoft Access] Error de sintaxis (falta operador) en la expresi?n de consulta ‘id = &nbsp’.
SELECT nombre FROM proveedores WHERE id = ORDER BY nombre

the error is in this file
Script: C:Program FilesNetMakev6wwwrootscriptcaseappconstructoragrid_informes_det_1grid_informes_det_1_lookup.class.php (49)

and this is the file content:

<?php
class grid_informes_det_1_lookup
{
//
function lookup_proveedor(&$conteudo , $proveedor, &$nm_array_retorno_lookup)
{
$nm_array_retorno_lookup = array();
if (trim($proveedor) === “”)
{
$conteudo = " ";
return ;
}
$conteudo = “”;
$nm_comando = “SELECT nombre
FROM proveedores
WHERE id = $proveedor
ORDER BY nombre” ;
$_SESSION[‘scriptcase’][‘sc_sql_ult_comando’] = $nm_comando;
$_SESSION[‘scriptcase’][‘sc_sql_ult_conexao’] = ‘’;
if ($rx = $this->Db->Execute($nm_comando))
{
$y = 0;
$a = 0;
while (!$rx->EOF)
{
if (isset($rx->fields[0]))
{
$nm_array_retorno_lookup[$a] = trim($rx->fields[0]);
$a++;
if ($y == 1)
{
$conteudo .= “<br>”;
$y = 0;
}
if ($y != 0)
{
$conteudo .= “”;
}
$y++;
$nm_tmp_form = trim($rx->fields[0]);
$conteudo .= $nm_tmp_form;
}
$rx->MoveNext();
}
$rx->Close();
}
elseif ($GLOBALS[“NM_ERRO_IBASE”] != 1)
{
$this->Erro->mensagem(FILE, LINE, “banco”, $this->Ini->Nm_lang[‘lang_errm_dber’], $this->Db->ErrorMsg());
exit;
}
}
}
?>

please fix this bug !!

Aquiles

Re: lookup in grid application don’t work after the last update !!

Hello,

On the onScriptInit set some value to the field and you will be able to do a lookup regardless if it is a virtual or aan existing field.

e.j.

onScriptInit

{myLookupField} = “something”;

regards,
Bernhard Bernsmann