This topic is locked
[SOLVED]

 Defaut Filter List

10/5/2010 11:40:21 PM
ASPRunnerPro General questions
S
surfermac author

i saw this post years ago about setting a default value in the quick search in the list page. For example we have a status column and by defualt we want to show "OPEN" projects. users then can go in the advance or quick search to change it to all/"blank" Let me know what is the easiest way to approach this?
Thanks.

A
ann 10/6/2010

Hi,
use Before SQL query event to filter List page according to some project status field:

if not IsEmpty(Session(CSmartStr(strTableName) & "_advsearch")) then

doAssignmentByRef searchClauseObj,unserialize(Session(CSmartStr(strTableName) & "_advsearch"))

if not searchClauseObj.isUsedSrch() then

strWhereClause = whereAdd(strWhereClause,"Status='Open'")

end if

end if



where Status is your actual field name.