This topic is locked

Master Details Question

8/3/2010 3:27:39 PM
PHPRunner General questions
greggk author

I have a display question regarding the master / detail on the list page.
I'm using 5.2 and I have the master --> details as a popup in the software.

So, currently on the list page of the master, you can mouse over the child record and it will show the "details preview" popup.

My question is, instead of the "details preview" popup, can I have the regular "VIEW" popup instead?
If that is not possible, can I change the link when you click on the child to go directly to the VIEW page instead of the LIST page?

Thanks in advance for any suggestions :-D

A
ann 8/4/2010

Hi,
this task requires a lot of custom coding in the generated files. Unfortunately we don't have a ready to go solution for this.

As workaround you can add create a link which send you directly to the view page.

Proceed to the After record processed event on the Events tab and add a code:

$rstmp=CustomQuery("select chId from ChildTable where chFieldName=".$data["mFieldName"]);

$datatmp = db_fetch_array($rstmp);

$record["childtable_dtablelink_attrs"]="href=ChildTable_view.php?editid1=".$datatmp["chId"];



where ChildTable is your actual child table name, chId is child table key field name and chFieldName, mFieldName are link fields of the child and master table correspondingly.

greggk author 8/4/2010



Hi,
this task requires a lot of custom coding in the generated files. Unfortunately we don't have a ready to go solution for this.

As workaround you can add create a link which send you directly to the view page.

Proceed to the After record processed event on the Events tab and add a code:

$rstmp=CustomQuery("select chId from ChildTable where chFieldName=".$data["mFieldName"]);

$datatmp = db_fetch_array($rstmp);

$record["childtable_dtablelink_attrs"]="href=ChildTable_view.php?editid1=".$datatmp["chId"];



where ChildTable is your actual child table name, chId is child table key field name and chFieldName, mFieldName are link fields of the child and master table correspondingly.


Thanks, this may work. Could you take a look at my code? I may have gotten something wrong. The Child table is called SOW, the child ID is just ID and the child field name is Projects and corresponds to the master field name Location. With that info, here is my code:
$rstmp=CustomQuery("select ID from SOW where Projects=".$data["Location"]);

$datatmp = db_fetch_array($rstmp);

$record["SOW_dtablelink_attrs"]="href=ChildTable_view.php?editid1=".$datatmp["ID"]
The error I'm getting is something like this:

Too few parameters. Expected 2., SQL state 07001 in SQLExecDirect

URL localhost/demo/Projects_list.php

A
ann 8/5/2010

Hi,
here is the code for the text link fields:

$rstmp=CustomQuery("select ID from SOW where Projects='".$data["Location"]."'");

$datatmp = db_fetch_array($rstmp);

$record["SOW_dtablelink_attrs"]="href=ChildTable_view.php?editid1=".$datatmp["ID"]
greggk author 8/5/2010



Hi,
here is the code for the text link fields:

$rstmp=CustomQuery("select ID from SOW where Projects='".$data["Location"]."'");

$datatmp = db_fetch_array($rstmp);

$record["SOW_dtablelink_attrs"]="href=ChildTable_view.php?editid1=".$datatmp["ID"]



Well, I tried the code, and I get the same error. I researched the error online, and it seems it may be an issue with the microsoft access database? Maybe I forgot to mention that in my previous post, but I'm using an ACCESS database for this project. The code itself seems good, maybe it's just the access database having issues? Is there another query I could try for the access database? If not, is there a way for me to change from the access database to a mysql database without having to remake my entire project?

A
ann 8/6/2010

Hi,
it's difficult to tell you what's happening without seeing actual files.

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.