Customize Subpanel Display

Is it possible to customize the look of the data displayed in a sub panel’s default view? I created a subpanel folder in my module’s custom folder and added the following to the default.php file inside the folder and it is not working. Any thoughts on how to make this work? I basically want the Coverage column to read “650 in” instead of “650”.

'quo_aa_coverage' => 
    array (
      'type' => 'varchar',
      'vname' => 'LBL_QUO_AA_COVERAGE',
      'width' => '10%',
      'default' => true,
      'customCode' => '<span sugar="slot3b">{$fields.quo_aa_overage.value} in</span>',
    ),

Thanks!

Hello,

You can’t apply custom code in subpanel. You can use process record logic hook to achieve it.

1 Like

Thanks for the reply. Can you point me in the direction of what that might look like? I have tried the code snippet below with no luck.

 function process_record_method($bean, $event, $arguments) {
    	$bean->quo_aa_overage = $bean->quo_aa_overage . " in";
    }

Thanks.

Code seems to ok.
Cab you see this field in your subpanel ? if not add it via studio in your subpanel layout.

After adding this field in subpanel layout. print some value into logic hook to make sure your process record is working.

1 Like

Here is an example of a process record logic hook I just done:



class instant_edit
{
    function instant_edit(&$bean, $event, $arguments)
    {

        global $app_list_strings;


        if (!isset($bean->account_role) || $bean->account_role == ""){
            // must have value to click on, so show --- when not set
            $bean->account_role='<span id="'.$bean->id.','.$bean->accounts_accounts_1accounts_idb.'" title="Click twice to edit..." onclick="instant_edit($(this));" class="editable">---</span>';
        }
        else {
            $bean->account_role= '<span id="'.$bean->id.','.$bean->accounts_accounts_1accounts_idb.'" title="Click twice to edit..." onclick="instant_edit($(this));" class="editable">'.$app_list_strings['roles_1_list'][$bean->account_role].'</span>';

        }
    }
}

1 Like

Thanks for the replies. It turns out I had a typo in the array where I was defining my process_record logic hook.