I’ve created a custom file that calls a global function to carry out background processing which is working correctly and I want to redirect so I’ve added the following event after reading other topics:
public function pageUnload()
{
//Log("Page Unload");
$this->setSuccessMessage("Roll Forward Successful");
$this->terminate("index");
}
pageUnload displays the message but doesn’t redirect whereas pageLoad displays the message and redirects successfully, but doesn’t carry out any processing!Contents of custom file below:
if (CurrentUserLevel() == -1) {
$league_id = ExecuteScalar("SELECT current_league_id FROM season_master WHERE current_season='1'");
} else {
$league_id = CurrentUserInfo("league_id");
}
$rsold=ExecuteRow("SELECT * FROM league WHERE league_id = " . $league_id);
$rsnew=$rsold;
$rsnew["season_id"] = $rsold["season_id"] + 1;
print_r2(rollForward($rsold,$rsnew));
//echo "Season Roll Forward complete\n";