History subpanel with custom fields

hi to all. i’ve added 2 custom field in note, and i want them shown in the subpanel of the history in the account view. i see there is not a way to do it via studio, so i’m trying to dig it in the code. any suggestion where to edit something?

thanks

Hey there,

You’re right that the History Subpanel can’t be found in Studio, as its a sort of custom-subpanel that is built up by combining several modules (Emails/Notes/Calls/Tasks/Meetings)

You should be able to add your fields to this, but it’ll be a little awkward as there are many files in action here.

I’ve found an old WebArchive link to an old SugarCRM developer blog that suggests steps towards adding Custom Fields to the History Subpanels, which might point in the right direction:


Seems like a pair of “ForActivities.php” and “ForHistory.php” files will need to be created for each of the Calls/Meetings/Tasks/Emails/Notes modules, in the /custom/modules/[modulename]/metadata/subpanel location

There have been some large divergences from SugarCRM, but I would think this solution should still work

However, let us know if you need any help!

(Or, if anyone knows of any quick tips to resolving this, that’d be much appreciated also! :slight_smile:)

Actually the link you posted doesn’t work. i will find something else

Hey,
The link did work on the 12th, but I’m having issues connecting now too.

Perhaps there are server issues on the web.archive.org end?

Unfortunately, I couldn’t find anything else in terms of guides, so hopefully the link becomes available again soon

However, if you find an alternative method to achieving this, we’d love to know!

So, seems i have find out the solution.
first of all, in every module -> metadata->supanels there is a file called ForHistory.php

in this file there are the rules of what column you want to show.
So for my need i went in module->notes->metadata->subpanels->ForHistory.php

i’ve copied this file in the custom folder(in my custom Notes there werent the subpanels folder, so i made it).

then i just added the field i needed (note_date_c) in the file. and it will be shown with all of the other columns.

the only problem is the “LBL” doens’t work. so if you use the LBL_NOTE_DATE it doesn’t work at all (in the coulmn header show “LBL_NOTE_DATE”).
and if you want to remove a column from history you have to put in EVERY custom modules(call, meeting, task, note, email) theyr ForHistory.php and delete from ALL those files the column you don’t want anymore.

if you don’t understand something let me know. it worked for me.

1 Like

Info very much appreciated!
Glad you’ve got a solution!

1 Like

Hi!

I want to add a note preview, and I tried following what you said but I didn’t really understand since I’m really new at this. If you have time could you explain to me in detail how its done?

To set the label, you need to specify the translations in the “Meetings” module.

Is there a way to remove date created? I removed it from all 5 modules forHistory but it still shows up but blank.