Hello,Is there a way to show ‘Master’ fields on the ‘Detail’ screen? For example, lets say I have a Customer (Master) and Orders (Detail) relationship. The tables are linked on the Customer ID field. I understand the master/detail view but lets say the order has a lot of detail and the user wants to open the detail record in a separate screen. The detail screen shows the Customer ID (linked field) but how would I show the Customer Name without a lot of work. I would assume I would need some sort of Custom Template. I like the current layout and just want to add the ‘Customer Name’. Is there a relatively easy way to do this?Thanks,Joe
Try:echo $GLOBALS[‘Customer’]->CustomerName->CurrentValue;
Thanks for the reply.I put that code on Server Events/Table Specific/Add-Copy Page/Page_Render and nothing shows up.Thanks,Joe
It won’t work in Add Page, because data in all fields by default are empty or blank.
OK. ThanksÂ.
This feature is reall a must.
What I do is to copy some of the code of the view page wich contains the masterview, remove the view things and attach to startup script.
hard way…
JoeB7774 wrote:
lets say I have a Customer (Master) and Orders (Detail) relationship. The tables are linked on the Customer ID field. I understand the master/detail view but lets say the order has a lot of detail and the user wants to open the detail record in a separate screen. The detail screen shows the Customer ID (linked field) but how would I show the Customer Name…
The current master record’s ID is stored in session variable, you may get it in detail table pages by, for example, $this->CustomerID->getSessionValue(). To show the customer name, you may just use:
$customerID = $this->CustomerID->getSessionValue();
if ($customerID) echo ExecuteScalar("SELECT CustomerNamer FROM Customer WHERE CustomerID = " . $customerID); // Assume Customer ID is integer, otherwise you need to quote the value