AnsweredAssumed Answered

Add custom code to the record view on SugarCRM 7.5

Question asked by Oscar Castro on Feb 19, 2016
Latest reply on Feb 19, 2016 by Rodolfo Jesus


On SugarCRM C.E 6.5 i can add a custom code to the edit or detail view through Smarty like this:

'lbl_editview_panel1' => 
  array (
    0 => 
    array (
      0 => 
      array (
        'name' => 'Items',
        'label' => 'LBL_ITEMS',
        'customCode' => '{show_items parent_id=$ fields=$fields view="edit"}',


Calling a Smarty function and return a .tpl file:

    function smarty_function_show_items($params, &$smarty) {
        $parent_id = $params['parent_id'];

        $items=FnCrm::getItems($parent_id); //Search and return the items from the db
        $smarty->assign('items', $items);

        return $smarty->fetch("custom/partials/Items/item.tpl");


And the .tpl content:

  {foreach key=key item=item from=$items}


The question is, what is the best solution to implement a custom code like this on a single module on SugarCRM 7 through Sidecar and Handlebars?


Thanks for the help.