Access the CurrentMasterTable from Row Rendered event?

There is often a the small table at the top of a list page, that displays the parent of the current list page. I believe it is called the CurrentMasterTable but I will call it the parent table.
There is data in that parent table (company name etc) that I want to insert into the child list rows whenever certain keywords appear in those rows.
What I’d like to do is grab some data from the parent table and do a find and replace with that data in the child table.
I can do it on the client side very easily with Jquery, but that only works with the list page and not the export of the list page. There is no client side scripting for export events. So I need to do the find and replace in a Server Event, in the hope it will work for both the export function and the regular html render.
Trouble is, I’m not aware of a list page server event that has access to the parent table. A list page’s Row Rendered event can’t see its parent data, as far as I can tell. Is there such an event? I want the data to be in scope already. I don’t want to be firing off an sql query for every row rendered to go grab it. That would be 200 extra queries per page!The alternative might be to set some global variables, capturing the data in the parent table, at some event on the previous (parent) list page, and then use those variables in Row Rendered on the current (child) list page. But what event would capture the data for the particular parent record that the user has just clicked on? And how do I pass variables from one page to another? Is it enough to just declare them as global, or something?

Boy I hope that makes sense.

Thanks in advanceJohn

Assume your master table name is “master”, and one of the fields in the master table you want to get its value is “My_Field”, then simply put the following code in “Row_Rendered” of your detail table:echo $GLOBALS[‘master’]->My_Field->CurrentValue;

Perfect! Thanks a million. Worked very easily.

How this task can be achieved in Master/Detail Add and assign master value to a detail (default) field.Please help.

@shahparzsoft,

You may use jQuery code (and put it in “Startup Script” under “Client Scripts”) to assign the master value to the related detail field.

After user input the value in master field and the cursor leave the field, then assign the related field in detail section with the master value.

I tried to test this solution for PHPMaker 2021 but it doesn’t work because it indicates that $ GLOBALS [‘mytable’] is a non-valid o existent index. In my case, what I want to retrieve is data from the master table to use as a record filter in a lookuptable in the child table

For v2021, you may simply use:

// adjust "master" to your actual master table name, and My_Field to your actual field name
echo Container("master")->My_Field->CurrentValue;