protected function getRecordViewButtons(\AbstractMetaDataParser $parser, $type)
    {
        $keyDp = null;
        foreach ($parser->_viewdefs['buttons'] as $key => $buttonsType) {
            if ($buttonsType['type'] === $type) {
                $keyDp = $key;
                break;
            }
        }

        if (is_null($keyDp)) {
            throw new SugarException("Can't find the $type array in record.php");
        }

        return $parser->_viewdefs['buttons'][$keyDp]['buttons'];
    }