Hi Tejas
You need to:
1. create the account_id and account_name into extended vardefs of Bugs as non-db fields:
custom/Extension/modules/Bugs/Ext/Vardefs/vardefs.ext.php
PHP Code:
$dictionary['Bug']['fields']['account_id'] = array(
'name' => 'account_id',
'id_name' => 'account_id',
'vname' => 'LBL_ACCOUNT_ID',
'type' => 'relate',
'table' => 'accounts',
'dbType' => 'id',
'source' => 'non-db',
);
$dictionary['Bug']['fields']['account_name'] = array(
'name' => 'account_name',
'vname' => 'LBL_ACCOUNT_NAME',
'type' => 'relate',
'reportable' => false,
'source' => 'non-db',
'table' => 'accounts',
'id_name' => 'account_id',
'module' => 'Users',
);
2. Go to Admin -> Repair -> Rebuild Extension
3. Add the account_name field into DetailView/EditView through Studio
4. Create a logic_hook before_save for Bugs to add the account_id into relationship table it it does not exist.
5. Create a logic_hook after_retrieve for Bugs to display the account_name into layout.
Regards
Bookmarks