NetTalk Central

Author Topic: setting value to use as filter in later browse  (Read 3673 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
setting value to use as filter in later browse
« on: March 27, 2009, 04:13:13 PM »
Hi,
I want to have the user give a numeric value when they log in.  This will be the Site_id.
When they browse the records, I want to have them filtered by "site_id" so that they see only the records for their site.
Question:
When they enter their Site_Id at login, do I set it as a value in the session Queue?
Where do I set the embed to do that?
If I do, then how do I use that in the filter expression in the browse???
TIA,
R Jolda

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: setting value to use as filter in later browse
« Reply #1 on: March 28, 2009, 11:13:00 PM »
Hi,

On the login form, inside the "ValidateUpdate 2.End" embed point. Verify they have logged in correctly then save SiteID in session queue.

p_web.SetSessionValue('_siteID',SiteID)

I use a leading _ to help me know my session values that are special, you don't want to accidently use the field name again somewhere.

In a browse use a filter like this:

'XYZ:SiteID = '&p_web.GSV('_siteID')

Thats it!

Regards
Bill Shields

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: setting value to use as filter in later browse
« Reply #2 on: March 29, 2009, 06:08:10 PM »
Filters can be sometimes be tricky. If SiteID is a string you may need to wrap it in  <39>

'XYZ:SiteID = <39>'&p_web.GSV('_siteID') & '<39>'

If you have complex filters I find it easier to set them in an embed point where I can debug.

Kev