NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: rupertvz on July 05, 2015, 06:54:07 AM
-
Hi Guys,
Upon a user logging in, I am setting GLW:Pfe (session value) to a record-value saved in the user table.
When I use a NWB filter, for example: 'I400:Pfe = '&p_Web.GetSessionValue('GLW:Pfe')
The filter only picks up records, if GLW:Pfe has a numerical value. When the value is alphabetic - no records are displayed.
I've tried by recreating the NWB, but same result.
When I set LOC:Pfe in the NWB to the value of p_Web.GetSessionValue('GLW:Pfe')
And use LOC:Pfe as a Range Limit value, it works fine.
Is this a problem with Filter expression?
-
'I400:Pfe = '&p_Web.GetSessionValue('GLW:Pfe') This is for Numeric Value only
For String Value or Numeric should be
'I400:Pfe = '''&p_Web.GetSessionValue('GLW:Pfe')&''''
Cheers
Vinnie
-
Hi Rupert for easier readability I use
'I400:Pfe = <39>' & p_Web.GetSessionValue('GLW:Pfe') &'<39>'
it's exactly the same as Vinnie's answer but I find it easier than trying to count the ' characters
-
Thank you Terry, Vinnie,
This will help a great deal!
I found sometimes that a NWB filter won't apply until I add the variable to the browse columns,
Is this a prerequisite for filter expression variables?
-
Not as far as I know
as long as the first part of the expression is a field in the table and the second part is a session variable value there should be no problem.
If the database is SQL and the first part of the expression is a database field which doesn't appear in the browse you may need to add it as a view field, not as a field in the browse, but I haven't ever done that so I am not sure.
-
>> I found sometimes that a NWB filter won't apply until I add the variable to the browse columns, Is this a prerequisite for filter expression variables?
No.
cheers
Bruce