Undefined function CurrentMasterTable

Hi,

Called from List Page > Page_Render (v2025.5)

    if(CurrentMasterTable()->TableName=="MapPoints"){
    //CurrentMasterTable()->ID->Visible = false;
    //CurrentMasterTable()->MapID->Visible = false;
    //CurrentMasterTable()->CategoryID->Visible = false;
    //CurrentMasterTable()->SubcategoryID->Visible = false;
    //CurrentMasterTable()->Latitude->Visible = false;
    //CurrentMasterTable()->Longitude->Visible = false;
    //CurrentMasterTable()->UserUUID->Visible = false;
    //CurrentMasterTable()->Type->Visible = false;
    //CurrentMasterTable()->IconColor->Visible = false;
    //CurrentMasterTable()->IconUrl->Visible = false;
    //CurrentMasterTable()->Active->Visible = false;
    //CurrentMasterTable()->Description->Visible = false;
    }

this worked on PHPMaker2023
returns following error on PHPMaker2025.5

Call to undefined function CurrentMasterTable()

Try:
if($this->getCurrentMasterTable() == "MapPoints"){

1 Like

Thanks,

$this->getCurrentMasterTable()

dumped as string(9) “MapPoints”

Trying to acheive hiding parent fields from display.

    CurrentMasterTable()->IconColor->Visible = false;
    CurrentMasterTable()->IconUrl->Visible = false;
    CurrentMasterTable()->Active->Visible = false;
    CurrentMasterTable()->Description->Visible = false;

If master table is MapPoint
and detail table is Images

and each MapPoint can have unlimited images

when i list images via the master table link:

/imageslist?showmaster=MapPoints&fk_ID=3

I want to hide most of the Master table fields using
CurrentMasterTable()->Active->Visible = false;

So I need to do it in MapPoint table but what event do I target?

You may get the master table object in the List page of the detail table by Container("MapPoint").

Container(‘MapPoints’) returns:

Call to undefined function Container()

Where did you put your code? You cannot use it in Global Code.

detail table Images on list page → page render

Then the Container() function is defined. You may want to delete all scripts and generate again. If error occurs again, you should enable Debug and post the complete error stack trace and post your complete Page_Render server event.