Reputation: 1379
Please I would like to know how to change the display name (in view mode) of a field in Vtiger 7 when linking a custom module to an existing module such as Account Module. It keeps displaying the default numbering field. Please see the following 2 images: I would the text "INSURANCE-21" in Image 1 replaced for example by the Insurance company name let say "Williams Insurance Group" in Image 2. Any idea please?
Upvotes: 0
Views: 948
Reputation: 398
You must change module identifier. If you’ve ever tried to find an option to update a module identifier (the field that works as a link in a module) you most probably have noticed that vtiger do not allow this from the field editor. The only way to do it is using vtiger development library called Vtlib.
use the following code:
// Turn on debugging level
$Vtiger_Utils_Log = true;
$targetmodule = 'InsuranceCompanies';
$targetfield = 'insurance_company_name';
include_once('vtlib/Vtiger/Module.php');
include_once('vtlib/Vtiger/Field.php');
$module = Vtiger_Module::getInstance($targetmodule);
$field = Vtiger_Field::getInstance($targetfield, $module);
$module->unsetEntityIdentifier();
$module->setEntityIdentifier($field);
If you need to revert this back or make a backup, you need to backup the table vtiger_entityname
Upvotes: 0
Reputation: 329
Please find what is Insurance Company Name of the field name into a database. for example if field name like insurance_company_name then the queries become like that
UPDATE `vtiger_entityname` SET `fieldname`="insurance_company_name" WHERE `modulename` ='Accounts' and `tablename` = 'vtiger_account';
Upvotes: 1
Reputation: 1379
After a whole night and day of searching, I came out with a solution.
Not sure if any cons. but this is the fix that worked:
I updated this table vtiger_entityname
and set the column fieldname
to the name of the field that I would like to use as display name for the concerned module.
Hope it helps anyone who want to achieve the same result.
Upvotes: 0