This topic is locked

Value Disappearing for $srchObj->setFieldValue

5/4/2020 6:31:08 PM
PHPRunner General questions
M
MikeB941 author

phprunner 10.3 - build 34624
I'm using this code in the List page: Before process event to always have a default search if the user hasn't provided one (or removes one (show all) they've previously entered).
if( !$srchObj->searchStarted() ) {

$srchObj->setFieldValue("AC_Originator",'mikeb');

}
This works UNTIL I go into another page, for example the edit page (and either edit/save or return to list) or go into advance search and return with a Back to List - then the setFieldValue("AC_Originator",'mikeb') value is missing (shows blank on the search panel) and the list page returns ALL records BUT the $srchObj->searchStarted() is still set to true (so the code above isn't re-executed).
If I MANUALLY input the value into the search panel, it is retained as I move between various pages (edit, etc.) as expected. So I'm only losing the FieldValue when it's set within the List page: Before process event using $srchObj->setFieldValue("AC_Originator",'mikeb');
Thanks for your help!