Page 1 of 1

Validate user accoung

Posted: Tue Dec 18, 2012 9:02 am
by forgot
Hello

Can I get some how in SQL in General tap of Form Property user_id of current logging user?

So I create table with column document_owner related with zzsys_user.zzsys_user_id.

And Is it possible use in SQL query statement like
...
WHERE
zzsys_user.zzsys_user_id = XXX

Where XXX is hash or other variable with user_id that currently login.

Maxim

Re: Validate user accoung

Posted: Wed Dec 19, 2012 12:34 am
by admin
Maxim,

#zzsys_user_id# is what you are asking for but #access_level# is probably what you want.

BTW if you hard code a where clause into a Form's SQL make sure you put brackets around it ..

Code: Select all

SELECT * FROM customer WHERE (cus_employee = '#access_level#')
Otherwise you will get something like this that could give you mixed results.

Code: Select all

SELECT * FROM customer WHERE cus_employee = '#access_level#'
AND (cus_code  LIKE  "%mat%") 
OR  (cus_name  LIKE  "%mat%") 
OR  (cus_phone  LIKE  "%mat%") 
OR  (cus_mobile  LIKE  "%mat%") 
OR  (cus_fax  LIKE  "%mat%") 
OR  (cus_due_period  LIKE  "%mat%") )
All the hash variables you can use are here http://wiki.nubuilder.com/tiki-index.ph ... structure=

Steven