Need to add a field that displays a count of tasks associated with the lead/opportunity

Good Afternoon Folks,

I need to add a field to the opportunity form that simple displays a number corresponding to the amount of tasks associated with the record. Essentially, if there are 3 tasks associated with the record, I need it to display "3" and so on. Would this be difficult to do? There doesn't seem to be any calculated workflows or fields that would be able to do this. Any help would be greatly appreciated!

Best Regards,


It is certainly possible, but where exactly do yo want it shown?

In the detail view of the Lead, on the top?

In the List view of all Leads?

In the subpanel inside the detail view?

Hi, thanks for replying!

 This is a functionality their old system had. I essentially need it displayed in the lead layout, near the top. It also needs to be available for reporting (e.g would need to be a field).

Are you a PHP developer, or can you get one?

You can do that in the top of the Detail view with something like this:

That teaches you to customize the detail view and put a calculated value in to an pre-existing custom field.

You just need to add a bit of code to run an SQL count query, but that should be easy to do, there are many examples online on how to use SQL queries from within SuiteCRM.