【问题标题】:How to replace a build in relationship field by a flexrelate field如何用 flexrelate 字段替换内置关系字段
【发布时间】:2013-03-15 17:12:10
【问题描述】:

例如,在 Opportunities 和 Cases 中有直接指向客户的关系字段。我有一个集成到这些模块中的自定义模块。我可以为自定义模块添加一个单独的关联字段,但我想要的是一个仅允许帐户和自定义模块的 flexrelate。这可以通过在 parent_name 中设置一个特殊的选项列表来正常工作。但会在 db 中产生 parent_type 和 parent_id 字段。

如何配置 flexrelate 以便在选择帐户作为 parent_type 时保存到 account_id 并在选择自定义模块时保存到它的 id 字段?

flexrelate 的选项:

$app_list_strings['parent_type_display_custom']['CustomMod'] = 'CustomMod';
$app_list_strings['parent_type_display_custom']['Accounts'] = 'Accounts';
$app_list_strings['record_type_display_custom']['CustomMod'] = 'CustomMod';
$app_list_strings['record_type_display_custom']['Accounts'] = 'Accounts';

案例的附加 vardef:

$dictionary["Case"]["fields"]["parent_type"] = array (
  'name' => 'parent_type',
  'type' => 'link',
            'vname' => 'LBL_PARENT_TYPE',
            'type' => 'parent_type',
            'dbType' => 'varchar',
            'group' => 'parent_name',
            'options' => 'parent_type_display_custom',
            'len' => '255',

        );
$dictionary["Case"]["fields"]['parent_name'] =
        array(
            'name' => 'parent_name',
            'parent_type' => 'record_type_display',
            'type_name' => 'parent_type',
            'id_name' => 'parent_id', 
            'vname' => 'LBL_RELATED_TO',
            'type' => 'parent(_custom)',
            'source' => 'non-db',
            'options' => 'record_type_display_custom',
        );
$dictionary["Case"]["fields"]['parent_id'] =
        array(
            'name' => 'parent_id',
            'vname' => 'LBL_PARENT_ID',
            'type' => 'id',
            'required' => false,
            'reportable' => true,
            'comment' => 'eighter the Id of an account or a custommodule'
        );

【问题讨论】:

  • 正如我现在所看到的,我应该为此编写一个特殊的 SugarField。很难弄清楚如何修改 EditView.tpl。现在我想知道我是否应该编写一个将 ids 复制到正确字段中的 js。

标签: sugarcrm


【解决方案1】:

【讨论】:

  • 看起来很有希望。下周我会试一试。非常感谢约翰。下次我应该更深入地搜索;-)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-12-03
  • 1970-01-01
  • 2022-01-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-01
相关资源
最近更新 更多