History Module list view customization

Hi All,
I want to customize history module list view in accounts detail view page and Lead detail view page.
Below are the requirements
1.Some column has to remove and add
2.Emails record based on department i need to display.

Kindly let me know the process and where i can add the columns and custom query(Where condition).

Thanks,

Hi Bala,

You can customize - modules\History\metadata\subpaneldefs.php

You can find key - where in defs for email.

Regards,
Alpesh Savaliya

Thanks Alpesh Savaliya,

But I want to adding the where condition in dynamically.

For example,
Email name i have fixed list, So based on name i will filter the records.

If not understood let me know i will try to give clear process.

Regards,

Hi Bala,

There is a way … but not much advisable.

You can write your logic into defs file itself if you have fixed list of email addresses.
Make sure your logic runs only for specific conditions.

Thanks.

Thanks Alpesh Savaliya,
My query will be like below format,

SELECT * FROM emails WHERE name =’’ AND deleted=0;

Defined values are in drop down 1.Reminder 2.Requirements 3.News 4.Feed Back 5. Bugs.

So how we can do the filter with SQL query.

Regards,

Hi

You can have like this if you want to filter with any of values.

‘where’ => “(emails.status=‘sent’ OR emails.name= OR emails.name=)”,

Regards,
Alpesh

Hi Alpesh,

‘where’ => “(emails.status=‘sent’ OR emails.name= OR emails.name=)”,

How to pass the value to defs files??

Regards,

Hi :slight_smile: ,

You can override history subpanel in file : /custom/Extension/modules/[ MODULE ]/Ext/Layoutdefs/layoutdefs.ext.php

For example :

$layout_defs[MODULE] = array(
‘collection_list’ => array(
‘tasks’ => array(
‘module’ => ‘Tasks’,
‘subpanel_name’ => ‘ForHistory’,
‘get_subpanel_data’ => ‘function:getHistory’,
),
),
)
Addn function getHistory() to your module class file with mysql query as you want result for your subpanel…

for example

function getHistory() {
$mysqlQuery = “Your select query for subpanel data”;
return $mysqlQuery;
}

Try this may help you…