I have a link that opens a dashboard with 3 objects.
- Client view
- Client detail view page
- Client detail add page
On the 2nd object I am trying to show the client detail view with the latest session.
On the Dashboard Before Process I have:
$record = $pageObject->getCurrentRecord();
$max = DBLookup("select max(SessionNumber), ClientID, EMPID from tCaseNote where ClientID='".$record["ClientID"]."' and EMPID='".$record["EMPID"]."'");
$srchObj = SearchClause::getSearchObject("tCaseNote");
$srchObj->setSearchOption("SessionNumber", EQUALS);
$srchObj->setFieldValue("SessionNumber", $max );
I do note that in the documentation on the search API that it only states use on list page.
Has anyone done this?