自定义字段未出现在sugarCRM中

for*_*rik 2 sugarcrm custom-fields

我在custom / Extension / modules / Calls / Ext / Vardefs中创建了一个自定义字段sugarfield_ast_rec_link_c.php,内容如下:

<?php
$dictionary['Calls']['fields']['ast_rec_link_c'] = array
('name' => 'ast_rec_link_c',
 'vname' => 'LBL_AST_REC_LINK_C',
 'type' => 'varchar',
 'len' => '255',
 'source' => 'non-db',
 'function' => array('name'=>'getRecordLink',
                     'returns'=>'html',
                     'include'=>'custom/modules/Calls/CustomLogic.php')
);

?>
Run Code Online (Sandbox Code Playgroud)

`还在custom / Extension / modules / Calls / Ext / Language中添加语言文件。快速修复后,我的自定义字段不会出现在Studio->通话->字段中。所以我不能把它放在视图上。有人可以帮忙吗?

ero*_*rop 5

你应该改变

<?php
$dictionary['Calls']['fields']['ast_rec_link_c'] = array(...);
Run Code Online (Sandbox Code Playgroud)

<?php
$dictionary['Call']['fields']['ast_rec_link_c'] = array(...);
Run Code Online (Sandbox Code Playgroud)

请记住,在定义新的自定义字段时,应始终将bean名称(而不是模块一!)用作$ dictionary数组键。我认为,使用自定义vardef检查是否一切正常的最佳方法是将自己的vardef与现有的vardef进行比较。cache/modules/<module_name>/BEAN_NAMEvardefs.php