Sometimes we the default entity identifier field is not imported for us and we want to change for another field that yes.

For example. In the Opportunity module the default identifier is “Opportunity Name”, but we want to need the “Opportunity No”. For this, we have to create a script like the next.


// Turn on debugging level
$Vtiger_Utils_Log = true;

require_once 'include/utils/utils.php';

$module = Vtiger_Module::getInstance('Potentials');

$module->unsetEntityIdentifier();//This unset the potentialname like a entity identifeir

$field = VTiger_Field::getInstance('potential_no',$module); //Now you get the field that you want to entity identifier

$module->setEntityIdentifier($field);//And finally you set this field.


and then modify the main class of the module. In the header change some references to the previous entity field, at least list_link_field.

Admin Manual
Developer Manual