This topic is locked

Default Value Master / Detail field

6/2/2008 1:48:15 AM
PHPRunner General questions
C
ckapote author

Hi,
I have a master table named tblreqmain with fields :

ID

Description

Vessel

Supplier1
and the other table connected with the master is called tblreqdetails with fields:
ID

Code

Qty

CSupplier1

connectid
I need CSupplier1 to get the value from Supplier1 field in inline edit and inline add pages.
I have tried other posts information such as smart- assign or i have tryied to enter in default value in CSupplier1 $_SESSION["Supplier1"] or $values["CSupplier1"]=$values["Supplier1"] etc. but nothing worked in my case

can you please help ??

J
Jane 6/2/2008

Hi,
use Add page: Before process or Edit page: Before process event on the Events tab.

Here is a sample:

global $strTableName, $conn;

$str = "select * from tabreqmain where ForeignJey=".$_SESSION[$strTableName."_masterkey1"];

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

$data = db_fetch_array($rs);

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

C
ckapote author 6/2/2008

Hi,

use Add page: Before process or Edit page: Before process event on the Events tab.

Here is a sample:


Thanks,

I have also to add on the above script : $values["CSupplier1"]=$_SESSION["Supplier1"]
Thank you very , very much once again Jane