Re: LOGIN: Retrieve the variable IdUser
Hi, I’m trying to use your recomendation but I fail, I put this in control_login onValidate Event:
$sql="SELECT nombre FROM usuarios WHERE email = {login}";
sc_lookup(dataset,$sql);
$user_id={dataset}[0][0];
sc_set_global($user_id);
then on a grid aplication y use this SQL Select Statement:
SELECT
id,
fecha_in,
folios,
remitente,
empresa,
consecutivo,
pdf,
estado,
fisico,
fecha_out,
director,
coordinador,
otro1,
otro2,
gte_tecnico
FROM
cartas
WHERE
director = '[user_id]'
Finally, in APPLICATION Global Variable I define this values: in Scope I check SESSION and GET and in Type I select In
When I see my grid I get this message (because I activate the Debug Mode):
(mysql): select count(*) from cartas where director = ‘’
(mysql): SELECT fecha_in, remitente, empresa, consecutivo, estado, fecha_out, id from cartas where director = ‘’ LIMIT 0,17
as you can see, I didn’t get any value for generate the grid.
Sorry, I am new with ScriptCase and I don’t have experience, maybe I forgot something? o I write something wrong?
Thanks in advice for your help.