NetTalk Central

Author Topic: Filters again using a local variable  (Read 5193 times)

Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Filters again using a local variable
« on: June 16, 2019, 07:03:09 PM »
Hi
In Webinar 195 Bruce demonstrated using a local variable to store the filter..

Im trying to filter a browse based on two variables

I want Employee  browse to only display those employees logged in  with the same parent Store as the employee who logged in on the current session.
I have set  p_web.SetSessionValue('ParentCompany',CLIP(EMP:ParentCompany))   on login
and EMP:ParentCompany is in the browse
My filter is
loc:filterParentStore = 'EMP:Loggedin = 1' & 'EMP:ParentCompany = '&'<39>'& p_web.GSV('ParentCompany')&'<39>'

Not working !

Thanks Richard

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Filters again using a local variable
« Reply #1 on: June 17, 2019, 12:48:40 AM »
H Richard,
You forgot the AND part in the filter string.

It should be:

 'EMP:Loggedin = 1 AND EMP:ParentCompany = '&'<39>'& p_web.GSV('ParentCompany')&'<39>'

The & is used as a concatenate operator and not as a locical operator.

Cheers,
René
Rene Simons
NT14.14

Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: Filters again using a local variable
« Reply #2 on: June 17, 2019, 07:51:42 PM »
Thanks Renee- fresh eyes!
Cheers
Richard