This topic is locked

Master table data

9/10/2008 10:41:35 AM
PHPRunner General questions
J
jshroads author

In general, how can I access the values of a few fields from a master record to pre-populate a detail record screen? Event code? Custom values? There is an example using events for ASP Runner, but I'm using PHP Runner...
Thanks

T
thesofa 9/10/2008

In general, how can I access the values of a few fields from a master record to pre-populate a detail record screen? Event code? Custom values? There is an example using events for ASP Runner, but I'm using PHP Runner...

Thanks



There is an examp-le of fast populating using Session variables if you look in the help file somewhere,AFAIK

J
Jane 9/11/2008

Jay,
select values from master table on theList page: Before process event on theEvents tab for detail table, then save it in the session variables and use these variables as default values on the"Edit as" settingsdialog on the Visual Editor tab.

Here is a sample code:

global $conn,$strTableName;

if (@$_REQUEST["masterkey1"])

{

$str = "select Field1, Field2 from MasterTable where Key=".$_REQUEST["masterkey1"];

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);

$_SESSION["Field1"] = $data["Field1"];

$_SESSION["Field2"] = $data["Field2"];

}