NetTalk Central

Author Topic: Conditional filters  (Read 3492 times)

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Conditional filters
« on: January 11, 2012, 10:03:33 AM »
   I'm trying to allow for an "Admin" user to see all items in a browse, and all other users to have the browse filtered based on the login name.  I created a conditional filter with the condition set as:

      p_web.GSV('Pathologist') <> 'Admin'

and the filter set as:

      'Spe:Pathologist=<39>'&p_web.GSV('Pathologist')&'<39>'


   When logging in as a typical (non Admin) user the filter works and the browse is filtered as expected.  However, logging in as "Admin" shows nothing in the browse.  I would expect the browse to essentially have no filter when Admin logs in.  Any thoughts on this?

Thanks,

Jeff King

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Conditional filters
« Reply #1 on: January 11, 2012, 12:49:55 PM »
Bear in mind your condition is case sensitive.
cheers
Bruce

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: Conditional filters
« Reply #2 on: January 11, 2012, 05:19:56 PM »
Bruce,

Just double checked and the case is correct.  Still does not filter as expected.  I'll go back and add the <39> to see if that makes a difference like it did for my default filter.

Thanks,

Jeff
« Last Edit: January 11, 2012, 05:21:39 PM by jking »

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: Conditional filters
« Reply #3 on: January 11, 2012, 05:40:38 PM »
Bruce,

I found the problem.  In my condition I was using 'Spe:Pathologist' when I should have been using 'Pathologist'.  I typed it in correctly in my original post but not in my code!  Also, the session variable 'Pathologist' is a combination of the first and last name of the user logging in.  I was looking for 'Admin' which is the user name.  Sheesh!

Thanks for your help.

Jeff