I need the next thing in SuiteCRM : when i save a contact (fill his first name and last name) i need to have in one field shortened first name. For example, instead John Smith i need to have J.Smith.
I did the next code:
class contactShortName
{
function getShortName($bean, $event, $arguments)
{
$bean->short_name = substr($bean->first_name,0,1) . '.' . $bean->last_name;
$bean->save();
}
}
But it didn’t work. Help please.