NetTalk Central

Author Topic: NWB Filter problem  (Read 4400 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
NWB Filter problem
« 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?

Vinnie

  • Full Member
  • ***
  • Posts: 183
    • View Profile
    • Email
Re: NWB Filter problem
« Reply #1 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

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: NWB Filter problem
« Reply #2 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
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: NWB Filter problem
« Reply #3 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?

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: NWB Filter problem
« Reply #4 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.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NWB Filter problem
« Reply #5 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