How can I fill a non-db field in a after_retrieve call?

I have created a custom field that is not a db field.  When I run an after_retrieve logic hook it should be filled with a message.

For some reason I can't get the field to populate. I know the function is running, because I get the error log.

I am working with the setAlertField function. 

Can someone point out why this isn't working?

Logic Hook Code, it is inside a class.

          function setAlertField(&$bean, $event, $arguments)
          {
                  $bean->alertfield_c = "Course not billed";
            $sql = <<<SQL
            SELECT contract.contract_status AS status FROM lev_contracts contract
                  LEFT JOIN lev_contracts_lev_courses_c connect ON contract.id=connect.lev_contracts_lev_courseslev_contracts_ida AND contract.deleted=0 AND (contract.contract_status = 'Proposal_Active' OR contract.contract_status = 'Proposal_Rejected')
                  LEFT JOIN lev_courses course on connect.lev_contracts_lev_courseslev_courses_idb=course.id and connect.deleted=0
                  WHERE course.deleted=0 AND course.id='{$bean->id}'
SQL;
                  $result = $GLOBALS['db']->query($sql);
            $bean->alertfield_c = 'Course not billed';
            $GLOBALS['log']->fatal('running setAlertField');
                  while ($row = $GLOBALS['db']->fetchByAssoc($result))
                  {
                    $bean->alertfield_c = '<pre style="border:2px solid #c00; padding: 5px;margin: 5px; color:#0000CC; text-align: center; width: 100%; text-decoration: bold;"> COURSE HAS BEEN BILLED - PLEASE BE CAUTIOUS WHEN MAKING CHANGES</pre>';
                  }
        }

Here is it being created

			array(
				'name' => 'alertfield_c',
				'vname' => 'LBL_ALERTFIELD',
				'type' => 'html',
				'source' => 'non-db',
				'module' => 'Lev_Courses',
			),

Parents Reply Children
No Data