NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: rupertvz on July 05, 2015, 06:54:07 AM

Title: NWB Filter problem
Post 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?
Title: Re: NWB Filter problem
Post by: Vinnie on July 05, 2015, 12:49:03 PM
  '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
Title: Re: NWB Filter problem
Post by: terryd on July 05, 2015, 09:46:10 PM
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
Title: Re: NWB Filter problem
Post by: rupertvz on July 06, 2015, 01:05:44 AM
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?
Title: Re: NWB Filter problem
Post by: terryd on July 06, 2015, 01:48:22 AM
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.
Title: Re: NWB Filter problem
Post by: Bruce on July 07, 2015, 03:10:07 AM
>> 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