Customizing Suite CRM fields

Viewed 233

I want to add i icon with the Suite CRM field on clicking of this icon it will open a popup and the popup will have text coming from the help attribute set in the field definition. This requires field level customization can anybody guide me that this task can be done in an upgrade safe manner or not?

1 Answers

Instead of changing the field (which is hard) you could use a non-db field and a logic hook.

$dictionary['lx_buildings']['fields']['myField'] =  array(
    'vname' => 'LBL_MYFIELD',
    'studio' => 'visible',
    'required' => false,
    'name' => 'myField',
    'labelValue' => 'Arq Status',
    'type' => 'text',
    'size' => '20',
    'rows' => '6',
    'cols' => '80',
    'source' => 'non-db',
    'inline_edit' => '0',
);

After the field definition you can add a Logic Hook in the module file named logic_hooks.php

$hook_array['after_retrieve'][] = Array(101, 'myLH', 'custom/modules/MOD/logic_hooks_after_retrieve.php','MyLH', 'MyLHFunc');

Finally the LH code you can set any HTML you want

 public function MyLHFunc($bean, $event, $arguments)
    {
      $bean->$myField = '<div class="container">Custom HTML Field</div>';
    }
Related