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;
}
}