History: change status field of note to custom value

Hi.

I’ve created a custom field in the notes Module named status_c
And I want to display it in the status row in the history subpanel. But it doesn’t work. It always displaying the label of the discription field.
I’ ve tried following in Forhistory.php:

// ‘status’=>array(
// ‘widget_class’ => ‘SubPanelActivitiesStatusField’,
// ‘vname’ => ‘LBL_LIST_STATUS’,
// ‘width’ => ‘15%’,
// ‘force_exists’=>true //this will create a fake field in the case a field is not defined
// ),
‘status_c’=>array(
‘alias’ => ‘status’,
‘force_exists’=>true
),

Can anyone help me please?
regards Robert

Hi,
Lol… history subpanel is not easy :slight_smile:

You must do many changement… for all “module” that appear in history sub panel… like : Notes, Email, Tasks, Calls,

look there for a try : https://community.sugarcrm.com/thread/18716

Regards

Copy

modules/Notes/metadata/subpanels/ForHistory.php

to

custom/modules/Notes/metadata/subpanels/ForHistory.php

Change

        'status' => [
            'widget_class' => 'SubPanelActivitiesStatusField',
            'vname' => 'LBL_LIST_SUBJECT',
            'width' => '15%',
            'alias' => 'status_c',
            'force_exists' => true,
            'force_default' => '(SELECT status_c FROM notes_cstm WHERE notes_cstm.id_c=notes.id) AS',
        ],