Does anyone know how can I reduce the number of characters displayed in the entries in a column of a subpanel?
This probably requires a bit of explanation so please bear with me.
I have a field that is a concatenation of 3 other fields, including the GUID generated by SuiteCRM. I use this field to be the unique name for a custom module. In order to provide a clickable link in subpanels or list views. Since most of the actual “name” is nonsense characters, I shorten it in the module’s List View with a “process_record” logic hook and the code:
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class truncateNameDisplay {
function shortenNameFieldLength( $fundBean , $event , $arguments ){
$fundBean->name = substr( $fundBean->name , 0 , 8 );
}
}
This does NOT permanently change the name; it just shortens it for display in the List View.
So this works fine for the List View in teh module itself, but I want to do the same for subpanels pointing to this custom module from other modules, Like Contacts and Accounts.
The field that displays this “name” is linkable so uses the
"'widget_class' => 'SubPanelDetailViewLink',"
I tried using displayParams to shorten the field but (to no surpise give it is a widget), this did nothing
'displayParams' => array (
'maxlength' => 8,
),
Does anyone know how to shorten/truncate the number of characters being displayed in a column entry in a subpanel (without actually changing the field value)?
- for fields that are using a widget like “SubPanelDetailViewLink”
- for “normal” fields like text fields, …