たとえば、商談とケースには、取引先を直接指す関係項目があります。これらのモジュールに統合するカスタム モジュールがあります。カスタム モジュールに別の関連フィールドを追加することもできますが、必要なのはアカウントとカスタム モジュールのみを許可する flexrelate です。これは、parent_name に特別なオプション リストを設定することでうまく機能します。しかし、結果はdbのparent_typeおよびparent_idフィールドになります。
アカウントをparent_typeとして選択するとaccount_idに保存され、カスタムモジュールを選択するとidフィールドに保存されるようにflexrelateを設定するにはどうすればよいですか?
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';
Cases の追加の 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'
);