Custom List View - access Hidden Fields?

I have the following custom code that strikes through all records in a list view where Status is “ex-employee”, and it works fine EXCEPT if the Status field is hidden.

So my questions are

  • Can I lock a column/field so that it is always returned and the user cannot change the view?
    OR
  • Can I return the value of the Status field regardless of whether it is visible/hidden?
class CustomListView extends Contact{
	function get_list_view_data()
	{
		global $current_user, $sugar_config;				
		$ret_fields = parent::get_list_view_array();
		
		if ($ret_fields['CONTACT_STATUS_C'] =='Ex Employee')
		{
			$ret_fields['FIRST_NAME'] = '<span class="required" style="color:black"><del>' . $ret_fields['FIRST_NAME'].'</del></span>';
			$ret_fields['TITLE'] = '<span class="required" style="color:black"><del>' . $ret_fields['TITLE']. '</del></span>';
			$ret_fields['REPORTS_TO_NAME'] = '<span class="required" style="color:black"><del>' . $ret_fields['REPORTS_TO_NAME']. '</del></span>';
			$ret_fields['PHONE_MOBILE'] = '<span class="required" style="color:black"><del>' . $ret_fields['PHONE_MOBILE'].'</del></span>';
			$ret_fields['PHONE_WORK'] = '<span class="required" style="color:black"><del>' . $ret_fields['PHONE_WORK'].'</del></span>';
			$ret_fields['PHONE_OTHER'] = '<span class="required" style="color:black"><del>' . $ret_fields['PHONE_OTHER'].'</del></span>';
			$ret_fields['EMAIL1'] = '<span class="required" style="color:black"><del>' . $ret_fields['EMAIL1'].'</del></span>';
			$ret_fields['CONTACT_STATUS_C'] = '<span class="required" style="color:black"><del>' . $ret_fields['CONTACT_STATUS_C'].'</del></span>';
		
	    }
		
		return $ret_fields;
	}
    }

@DCPAus
About your the first question.
You can:

  1. make custom file custom/modules/Contacts/views/view.list.php
  2. copy there all from file - modules/Contacts/views/view.list.php
  3. write child function prepareSearchForm:
    – make sure that (isset($_REQUEST['columnsFilter']) && $_REQUEST['columnsFilter'])
    – control array $this->listViewDefs as you want.
    – call the parent::prepareSearchForm() in the end

I don’t understand the second question. If the collumn don’t present in the listview there isn’t on the form. It isn’t hidden.

Thanks very much, I am a “beginner” programmer so will give it a go.