2

我在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')
);

?>

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

4

1 回答 1

5

你应该改变

<?php
$dictionary['Calls']['fields']['ast_rec_link_c'] = array(...);

<?php
$dictionary['Call']['fields']['ast_rec_link_c'] = array(...);

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

于 2012-04-10T11:08:01.350 回答