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.
Since very often our customers required us to change them I’m releasing the script I use every time I need to do it.
All you need to do is replace the with the name of the Module and the new field you would like to use as an identifier, and you’re ready to go.
// Turn on debugging level $Vtiger_Utils_Log = true; include_once('vtlib/Vtiger/Module.php'); include_once('vtlib/Vtiger/Field.php'); $module = Vtiger_Module::getInstance('Quotes'); $field = Vtiger_Field::getInstance('quote_no', $module); $module->unsetEntityIdentifier(); $module->setEntityIdentifier($field);
As you can see in the above example, I’ve replaced the identifier for the quote module from subject to the quote number.
If you need to revert this back or make a backup, you need to backup the table vtiger_entityname
If you think this post is valuable to you, please insert your email below so we can notify you of a new post!