This topic is locked

Display primary key fields automatically in details page

1/24/2010 2:12:23 PM
PHPRunner General questions
A
atacan author

Hi,
I have master-details tables with composite key and want to display the primary key fields from master table on the child add/edit page

automatically and disable the edit feature of these fields. When I set this up as master-details pages at PHPRunner it only does that

for first column (col1). Is there anyway to enable this feature for all primary key fields?
For example;
master_table

(

col1 varchar(30),

col2 varchar(30),

col3 varchar(30)

.

.

.

)

primary key (col1,col2,col3)
child_table

(

col1 varchar(30),

col2 varchar(30),

col3 varchar(30),

col4 varchar(30)

.

.

.

)

primary key (col1,col2,col3,col4)
At the add/edit page of child_table I want to display col1,col2 and col3 values from master table and make them non editable. Any help would be appreciated.

D
danaci 1/25/2010

at the detail table before record add event

global $strTableName,$dal;

$rstmp = $dal->master_table->Query("field_name=".$_SESSION[$strTableName."_masterkey1"],"");

$datatmp = db_fetch_array($rstmp);
use

$values["detailtablefieldname"]=$datatmp["mastertablefieldname1"];