This topic is locked

Setting default values

1/15/2009 5:40:38 AM
PHPRunner General questions
P
pfeiffha author

Hi, I'm new to PHPRunner and I have a general questtion:
I have a master/detail relation, say dokuments which belongs to a customer.

Opening the Custiomer list, I can choose his dokuments, and even when I want to add

a new document, the customer_id is automatically apperas on teh AddPage. That's fine.

What I need ist that I can fill up a document_field by using the customer_id and some

ther fields, also the document_id ( autoincremented value by MySql ).

So: how can I set the value so that it will be displayed when the AddPage is invoked?
Thank you for your efforts,
Hans

J
Jane 1/15/2009

Hi,
select values from master table in the Add page: Before process event on the Events tab for detail table and save it in the $_SESSION variables.

Here is a sample:

global $dal,$strTableName;

$rs = $dal->customer->Query("customer_id=".$_SESSION[$strTableName],"");

$data = db_fetch_array($rs);

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


Then use these variables as default on the "Edit as" settings dialog on the Visual Editor tab.

P
pfeiffha author 1/16/2009

Hi Jane,
thank you very much. Willtry out your idea!

Thank's a lot !!
Hans

Hi,

select values from master table in the Add page: Before process event on the Events tab for detail table and save it in the $_SESSION variables.

Here is a sample:
Then use these variables as default on the "Edit as" settings dialog on the Visual Editor tab.