This topic is locked

master detail hide links doesn't work after conversion to 10.6

11/2/2021 4:12:26 PM
PHPRunner General questions
D
droogers author

Hello,

I converted my project to PHPRunner 10.6 and now the following code in list page -> Before display isn't working. With this code I hided some links in the detail table when the master table tbldag with the field geboekt don't have the vaule 1.

global $strTableName,$dal;
$dal_table = $dal->Table("tbldag");
$rstmp = $dal_table->Query("ID=".$_SESSION[$strTableName."_masterkey1"],"");
$datatmp = db_fetch_array($rstmp);
if ($datatmp["geboekt"]<>"1")
{
$xt->assign("editselected_link", false);
$xt->assign("deleteselected_link",false);
$xt->assign("inlineadd_link", false);
$xt->assign("add_link", false);
}

What change do I have to made on the code ?

admin 11/2/2021

I do not have an exact answer to this but here are troubleshooting steps you should take in order to resolve this.

  1. I see that you use old APIs for retrieving data and getting the master table info. We recommend using the following:
    Database API
    getMasterRecord

This is not necessarily the issue but you want to eliminate all the potential obstacles.

  1. You need to make sure that tags like "editselected_link" and "inlineadd_link". You will have to switch to HTML mode on the Editor screen in order to do so. Do not make any changes, just lookup for those placeholders and make sure they spelled correctly.

D
droogers author 11/3/2021

Thanks for your reaction.
I changed some tags but this doesn't help. You said I also have to change the DatabaseAPI and get MasterRecord but I don't know how to do this.

admin 11/3/2021

Again, this is not necessarily an issue, it just makes sense using all the latest and recommended APIs. If you follow the links I posted you can see examples of both data retrieval and of accessing the master record info.

If nothing helps you can post your project to Demo Account and contact support directly. You just need to remember that this kind of assistance requires coding support.