I have a field in my Master table called 'UnitLabel' and my goal is to use that string as the label for a column in a child table that is displayed on the Edit/View pages of the master table. Currently, on the Edit and view pages, I am setting a session variable in the 'Before Display' event
$_SESSION['UnitLabel']=$values['UnitLabel'];
On the child table in the 'After Table Initialized' event, I am using the Labels API
//If the Unit Label is set in the EqList record, display this value as the label on the child table.
if ($_SESSION['UnitLabel']) {
Labels::setFieldLabel("psn_EqListHours", "UnitAdjustment", $_SESSION['UnitLabel']);
}
This code works but the session variable is set after the child table intializes so the label doesn't appear correctly until I refresh the page. Is there an alternate way to fetch that Label from the master table that will have it available before the child table initializes?