This topic is locked

Redirect to different edit pages depending on values

5/22/2011 10:10:02 PM
PHPRunner General questions
M
Marcos author

I'am developing an report-maker for a medical center, and depending on the selected practice on list page (with lookup wizard), must be redirected to different edit pages. Example:
Fields on list page: date & hour, name of patient, TYPE OF PRACTICE (1, 2, 3, ...)
Edit pages: EDIT PAGE 1, EDIT PAGE 2, EDIT PAGE 3, ...
How can redirect to correct edit page?
Thanks in advance
Marcos

J
Jane 5/23/2011

Hi,
you can use List page: After record processed event on the Eventsstab to check value in the TYPE OF PRACTICE field and define edit link for this record.

Here is a sample:

if ($data["TYPE OF PRACTICE"]==1)

$record["editlink_arrt"] = " href='TableName1_edit.php?editid1=".$data["KeyField"]."'";

if ($data["TYPE OF PRACTICE"]==2)

$record["editlink_arrt"] = " href='TableName2_edit.php?editid1=".$data["KeyField"]."'";
M
Marcos author 5/24/2011

Thanks Jane, it works! Now I try to extend this with select-case clause, because have more than 20 options or 'ifs'.
Marcos