AnsweredAssumed Answered

Adding config fields to a dashlet

Question asked by Rodrigo Morchio on Aug 16, 2017
Latest reply on Aug 18, 2017 by Rodrigo Morchio

Hello,

 

I'm trying to modify a custom dashlet in an Enterprise 7.8.2.1 Sugar instance, adding two fields to the dashlet config (it has none at this time). These fields should be used to filter the info the dashlet is showing.

 

This is my dashlet metadata file:

 

<?php
$viewdefs['base']['view']['indicadores-dashlet'] = array(
    'dashlets' => array(
        array(
            'label' => 'Indicadores semanales',
            'description' => 'Indicadores semanales',
            'config' => array(
            ),
            'preview' => array(
            ),
            'filter' => array(
                'module' => array(
                    'Contacts',
                ),
                'view' => array(
                    'record',
                )
            )
        ),
    ),
);

?>

 

And this is the same file after I try to add a config field:

 

<?php
$viewdefs['base']['view']['indicadores-dashlet'] = array(
    'dashlets' => array(
        array(
            'label' => 'Indicadores semanales',
            'description' => 'Indicadores semanales',
            'config' => array(
            ),
            'preview' => array(
            ),
            'filter' => array(
                'module' => array(
                    'Contacts',
                ),
                'view' => array(
                    'record',
                )
            )
        ),
    ),
    'config' => array(
        'fields' => array(
            array(
                'name' => 'ramos_c',
                'label' => 'LBL_RAMOS_C',
                'type' => 'enum',
                'isMultiSelect' => true,
                'options' => array(
                    'value1' => 'key1',
                    'value2' => 'key2'
                )
            ),
        ),
    ),
);

?>

 

I've tried modifying the field attributes, trying to make it a text field and so, with no luck. Whatever I do, when I run a Quick Repair and Rebuild and try to edit the dashlet its config panel remains blank.

 

Does anyone know if I'm missing something? I would appreciate any help on this.

 

Thanks,

Rodrigo Morchio

Outcomes