Logic hook in Contacts module

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.

That’s just a class with a function in it, you don’t say how you did to get that called from the hook… that’s probably where the problem is.