This topic is locked

where statement in list view

11/18/2009 5:22:53 AM
PHPRunner General questions
H
homer.favenir author

hi, how can i make my main list page to list only the dept of the user logged in
e.g. im the user, and im in the IT dept. when i logged in, the list that i will see is only from IT dept.
my main table has dept field and my user table has dept field also...
TIA

A
alang 11/23/2009

There are at least a couple of ways to approach this:

  1. In the event "Before SQL Query" you can refine the query by restricting to records where logged in user dept (from user table) matches the dept filed in your main table.
  2. Use Advanced security with option "user can view and edit own records only" and have the "ownership" based on dept field rather than individual ID. This option does not require PHP code.