I have an Edit form page where a User selects from one of 5 Events.
I want to show the User the details of the Event they have previously selected, if they already have saved the form with an Event_Id value, such as 1, 2, 3, 4, or 5.
So I must lookup the Events table to get the values of that event and then I want to Display fields from that particular Event IN the Edit form page of a different table.
The only script that works to retrieve those values from the Events table and display them is using the "Before Process" function. In this function I can ask for the values of the current record.
Like this:
global $dal;
$record = $pageObject->getCurrentRecord();
echo $record["event_id"];
global $conn;
if ($record["event_id"]> 0)
$strSQLExists = "select * from wp_pro2014_events where id=" .$record["event_id"]."";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
echo $mymessage = $data["event_id"] . "
" .$data["event_location"]. "
" . $data["event_city"] . "
" . $data["start_day"] . "
". $data["start_date"]. "
";
}
else
{
}
But the output is generated above the Header of the page.
The same script as a PHP Snippet fails because it does not recognize the CurrentRecord function.
How can I put the Lookup Fields down into the body of the Edit page form?