Footnotes option

1. Introduction

In SuiteCRM 8, you can add footnotes to fields definitions. This allows you to provide additional information or context about a field to users.

2. Footnotes Metadata Definition

The first thing to define is the footnotes entry in the metadata.

The configuration for the logic can be added to the vardefs.php or the detailviewdefs.php.

In the following example we are going to add one to the Opportunities module field vardefs.

2.1 Steps to add footnotes on the custom vardefs

  1. Create a new field in custom extensions for Accounts module:

    1. Example: public/legacy/custom/Extension/modules/Opportunities/Ext/Vardefs/probability.php

  2. Copy the probability definition from public/legacy/modules/Opportunities/vardefs.php

  3. Add the footnotes entry to the probability definition with the code on the snippet below.

    • Re-set permissions if needed (will depend on your setup)

  4. Run Repair and Rebuild on Admin menu

<?php

$dictionary['Opportunity']['fields']['probability'] = array(
    'name' => 'probability',
    'vname' => 'LBL_PROBABILITY',
    'type' => 'int',
    'dbType' => 'double',
    'audited' => true,
    'comment' => 'The probability of closure',
    'validation' => array('type' => 'range', 'min' => 0, 'max' => 100),
    'merge_filter' => 'enabled',
    'footnotes' => [
        [
            'labelKey' => 'LBL_NEW_ADDED_LABEL',
            'displayModes' => ['edit', 'create'],
        ]
    ]
);

Note: displayModes is used to define when the footnote should be displayed. In this example it is set to be shown only when creating or editing a record.

This should now display the footnote:

Opportunity Footnote

2.2 Other footnotes configuration options

Other configuration options for footnotes are:

Option Description Example

activeOn

Used to compare to the fields value to determine if the footnote should be shown.

'activeOn' ⇒ [ ['operator' ⇒ 'is-equal', 'values' ⇒ ['legacy'] ] ]

icon

This can be added to show an icon next to the footnote text. It uses the SuiteCRM icon library.

'icon' ⇒ 'info_circled'

iconKlass

This can be used to add custom classes to the icon.

'iconKlass' ⇒ 'mr-1 align-text-bottom svg-size-3 stroke'

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.