Show a field from the account module in the list view of contacts

The “Contact” module is (natively?) linked to the “Account” module. This means that when I create a new Contact, I can select an Account name (auto-select) in the form and link this new Contact to an Account.

This works perfectly so far. I can also extend the Contact list view with this link (account_name).

Now I would like to extend this “Contacts” list view with another field (account_current_status), which I created via “Studios” in the “Account” module. But I just don’t get it to work with Studios.

Am I too stupid, or is this something that “SuiteCRM” cannot do? How could I solve this with code? It seems so simple, as the link to the Account data already exists.

I appreciate any help!
Thanks!

#v7.11.15

Hello Cino,

that might not be easily possible in the CRM.
(yet, I have had similar requirements already in multiple projects).

You’d like to show the account status, when you’re working with contacts.
So some workarounds are:

  • You can build reports on the contacts and add the appropriate fields from contacts AND accounts
  • You can copy/sync the account status via a workflow to all the related contacts (not nice to copy data - but easy)
  • You can customize your list view via code, to load the details from the accounts
  • In SuiteCRM 8 you could add a custom sidebar widget

In version 7 this is fairly straightforward. You create a “non db” field and then populate it with function.

Here’s an example (I think it comes from the documentation). You setup your vardefs like shown and then you can calculate anything you want inside your function, even like pulling fields from related records.

<?php
$dictionary['Contact']['fields']['age_years'] = 
  array (
    'name' => 'age_years',
    'vname' => 'LBL_AGE_YEARS',
    'type' => 'int',
    'len' => '3',
    'comment' => '',
    'importable' => true,
    'function' => array(
        'name' => 'get_age_years', 
        'returns' => 'html', 
        'onListView' => 'true',
         'include' => 'custom/modules/Contacts/Contacts_fields_functions.php'
    ),
    'studio' => 'false',
    'source' => 'non-db',
    'inline_edit' => 0,
  );
 ?>

Note: I can’t remember if this works on listview (I’m like 80% sure it does). If not, you can also use a process record hook to process it.