calyn_gately
19th November 2008, 12:31
I have a session and a table view, when a session load, the data should be appeared according to user logname. May i know how to write the session script to filter the content according to user logname?
george7a
19th November 2008, 12:44
Hi,
The user log-in name is saved in a predefined variable called "logname$". In your session you will have to Filter the records where the user filed = logname$
I hope it helps,
- George
calyn_gately
20th November 2008, 12:45
;)Thanks for your reply.
Now i wish to filter the records according to logname$ once the screen loaded. May i know the script to generate that? The screen shot i have attached in previous time.
From
Yen ling
rahul.kolhe22
20th November 2008, 13:01
Hi,
You can use function query.extend.where() as shown below:
query.extend.where("ttmmm999.xxxx = " & logname$)
tt = package, mmm = module, 999 = table and xxxx = field for user ID
Hope it helps you.
- Rahul
_Ralph_
20th November 2008, 14:01
the predefined variable query.extension can be used to
toolswizard
21st November 2008, 02:47
As an alternative to coding you can also use authorizations to prevent rows of data showing by value.
calyn_gately
21st November 2008, 09:51
Hi Support,
May i know how to apply the script when the screen loaded into my programming script? Here i attach a file with the programming script and screen layout for your reference.
Appreciate your help. Thanks.
calyn_gately
24th November 2008, 04:48
After i have written the script into the before program, the error message prompt when i compile the session.
mark_h
24th November 2008, 06:03
Try this:
query.extend.select("tffam991.faur = " & chr$(34) & logname$ & chr$(34))
calyn_gately
25th November 2008, 03:01
I wrote the script in the before program section and i compiled the session and the error message pop up.
_Ralph_
25th November 2008, 18:31
Try this:
query.extend.select("tffam991.faur = " & chr$(34) & logname$ & chr$(34))
I guess Mark supposed to:
query.extend.where("tffam991.faur = " & chr$(34) & logname$ & chr$(34))
Just a Tip, instead of chr$ you can use the function quoted.string()
after all, guess it wont work. "logame$" have no valid value...
try this
query.extend.where("tffam991.faur = :"&logname$)
or you can built a string.
domain tcmcs.str100 ext.where
ext.where = "tffam991.faur = "&logname$
query.extend.where(ext.where)
debug it and see if the syntax its correct