Conditional formatting in lists?

Hello,

I need to change the formatting of some data in SuiteCRM 7.5 lists.

For example, in Accounts record, when showing related contacts, some fields would be bold, or coloured, according to some condition on the data shown.

Another example would be highlighting an entire row according to some condition.

I’ve searched online and found a few examples of how to do similar things with code, but all look complicated, some are not upgrade-safe, and some are only for SugarCRM 7 which I believe is different in many aspects.

Can somebody point me to the best practices on this in SuiteCRM? Thanks in advance!

By the way, I don’t mind if it’s difficult, involves coding, or even if it’s not upgrade-safe (if I can keep it under control and re-patch after each update).

I’m just looking for the best/more correct way to do it, even if it’s not a very good way. Thanks.

To answer my own question (it’s really a pity that nobody was able to help here…) I got some results (not perfect) with two separate techniques:

  1. Overriding the PreDisplay function in class ListView. This works for the big list views (like when you click to view all Contacts, or Accounts, etc), but not for the smaller lists in subpanels.

  2. Creating a ProcessRecord hook for the desired module. This works for subpanels, which is what I wanted.

Both methods have their limitations.

I can’t find a way to add formatting to entire list rows in subpanels. I can only format cells.

I think some work on the main framework could help here. Improving SuiteCRM to make it more customizable in data display. This sort of thing you do once and it brings advantages in many places. If anybody has ideas on how this should be done, I’d love to discuss them.

To keep answering my own question - though I must say this is getting ridiculous :- )

There is a very nice write-up by Jim Mackin here:

http://www.jsmackin.co.uk/suitecrm/suitecrm-list-view-conditional-formatting/

That is just for the part concerning List Views, which are the easiest to achieve.

2 Likes