This topic is locked
[SOLVED]

Default search criteria only one time

5/12/2025 7:10:31 PM
PHPRunner General questions
A
asawyer13 authorDevClub member

I want to have the search panel default to the value in a session variable when the user enters the list page.

$srchObj = SearchClause::getSearchObject("Employees");

$value = $srchObj->getFieldValue("Department");
if( $value == null ) {
$srchObj->setFieldValue("Department", 10 );
}

That works perfectly, however if the user does a show all or clears the search value, I want the user to be able to pull all records without the orignal value being considered.

Been struggling for a few hours on this, so any help would be apprecaited.

Alan

A
asawyer13 authorDevClub member 5/13/2025

I added some code and am trying to pass a variable on the url when I run the page, however it looks like it doesn't actually put the reset=1 on the url.

img alt

Can someone tell me what I'm doing wrong?

I'm expecting to see blah_list.php?reset=1 when I run the menu item, but I don't see it

Alan

A
asawyer13 authorDevClub member 5/13/2025

I also tried it without the ? since I don't think I'm supposed to use it.

Alan

A
asawyer13 authorDevClub member 5/13/2025

I needed to logout and back in.

Problem solved.

Alan