This topic is locked

Prevent a record from being shown in list view based on field value

2/3/2007 9:44:52 AM
ASPRunnerPro General questions
N
Norian author

Hello,
I was just wondering if it is possible to prevent a record from being shown in the list view, based on the value of a specific field. For example we currently have a table for tickets... if a tickets status is set to closed then we dont really want it being shown in the list view, but would like to be able to see it in the search's.
Is this possible?
Many thanks.

Sergey Kornilov admin 2/4/2007

If you like to hide some data on the list page you can add a WHERE clause to SQL server (Edit SQL query tab)
select ...

from ...

WHERE status<>'closed'

N
Norian author 2/16/2007

If you like to hide some data on the list page you can add a WHERE clause to SQL server (Edit SQL query tab)

select ...

from ...

WHERE status<>'closed'


Thank you this worked great and now the closed incidents cannot be seen on the list page, however I now cant search for these records. Is there a way to prevent items from being shown on the list page, but still be able to search them?
Many thanks. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=15575&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

J
Jane 2/16/2007

Norian,
you can do the following:

  • Check off No records on the first page option on the Edit SQL query tab.
  • Then open generated ..._list.asp file, locate following code snippet:
    if (Request.Form="" and Request.QueryString="") then strSQL = AddWhere(strSQL,"1=0")

and replace it with this one:

if (Request.Form="" and Request.QueryString="") then strSQL = AddWhere(strSQL,"status<>'closed'")