This topic is locked

Newbie Question : Default Value in MasterDetail ADD

11/24/2008 5:07:55 AM
PHPRunner General questions
N
netmedia59 author

Hello,
I have a Custom view called Exposants and a detail table called docky_prod

The ralation from the master to the detail is a field called ID (Exposants) and IDExposant (docky_prod)
I want to have Default values of the master in the detail ADD form as ExpoYear, Name, etc.
I'm sure I have to use the Event but I can't handle it
Could you help me
Thanks very much

J
Jane 11/24/2008

Hi,
useAdd Page: Before processevent for detail table on the Events tab for this purpose.

Here is just a sample:

global $dal,$strTableName;

$rs = $dal->Exposants->Query("ID=".$_SESSION[$strTableName."_masterkey1"],"");

$data = db_fetch_array($rs);

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

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



Then use $_SESSION["ExpoYear"] and $_SESSION["Name"] as default values on the "Edit as" settings dialog on theVsiual Editor tab.

N
netmedia59 author 11/24/2008

Hey Jane,
Thank you for your answer but unfortunatly, it doesn't work

I have an error : "Undefined property: tDAL::$Exposants"
Thank you
netmedia59

J
Jane 11/25/2008

Hi,
please make sure you use latest PHPRunner update:

http://www.asprunner.com/files/phprunner-setup.exe
If it doesn't help publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.