After adding a record on the Add page of a parent record, is there a way to view the Master/Detail page when I hit the “add” button. I looked under the parent table “Return Pages” section but there are only drop downs for Add/Delete/Edit/List/View but those dont show the Master/Detail view. Thanks in advance for any help.
JoeB7774 wrote:
I looked under the parent table “Return Pages” section but there are only drop downs for Add/Delete/Edit/List/View but those dont show the Master/Detail view.
The setting allows manual input, you can choose from dropdown, you can also enter your own return page, see the topic Table Setup → Return Pages in the help file, there are some examples.
Thanks for the reply. I reviewed the help files and added the following code to the redirecting event of the Add page of the parent table. The problem is that this fires when I hit the “+” sign at the bottom of the list page to add a record and not when I hit the “Add” button to actually add the record (after I insert all of the record information). I tried moving this to the Row Inserting event but that didnt work.
// Page Redirecting event
function Page_Redirecting(&$url) {
// Example:
//$url = “your URL”;
if ($this->CurrentAction == “A”) {
$url = “myURLInfo/tblJobSiteInspectionview.php?showdetail=tblJobInspectionHazards,tblJobInspectionWorkers&JobSiteInspectionID=” . urlencode($this->JobSiteInspectionID->CurrentValue);
}
}
JoeB7774 wrote:
this fires when I hit the “+” sign at the bottom of the list page to add a record
That is because you wrote:
if ($this->CurrentAction == “A”) {
The help file says you may enter the URL directly for the “After Add” setting, not using Page_Redirecting event.
Oh ok. I get it. I worked through the examples in the help file and I can get one of those to work. That being said, I can’t seem to get what I’m trying to do to work:
On the add page of the master record (not the master/detail), when the user hits the “Add” button, I want to view the Master Detail View of that record. I tried the following but it doesnt seem to work (I get a white screen despite having “show all errors” in my php.ini)
"
I have also tried & fk_
You need to replace
(and others) with the actual table/field names.Thats what I had (sorry I should have put those in there):
".php?showdetail=,&=†. urlencode($this-> < JobSiteInpsectionID > ->CurrentValue)
I put this in the “After Add” of my main table. When I click on the “+” to add a new record to the master table, I get the following error:
Parse error: syntax error, unexpected ‘InspectionDate’ (T_STRING) in C:\inetpub\wwwroot\jobsitedatabase\classes\tblJobSiteInspection_add.php on line 823
When I look at line 823, I see the following:
$val = $CurrentForm->hasValue(“InspectionDate”) ? $CurrentForm->getValue(“InspectionDate”) : $CurrentForm->getValue(“x_InspectionDate”);
Not exactly sure what I do here. I have set InspectionDate as both “Date” and “Short Text” in my Access Database but both produce the same error. Any ideas why InspectionDate might be throwing this error?
Try to put this code in “Row_Inserted” server event of your master table:
$this->terminate(“myURLInfo/tblJobSiteInspectionview.php?showdetail=tblJobInspectionHazards,tblJobInspectionWorkers&JobSiteInspectionID=” . urlencode($rsnew[“JobSiteInspectionID”]));
Thank you both for the help. That “Row Inserted” works perfectly.