vtigercrm - Adding custom dropdown(values dynamically from db) in the lead form in vTiger -
i new vtiger crm , need code add dropdown has values database table in add lead page. please provide solution if have ?
you can add drop-down field using bellow code , follow steps achieve result:
- add bellow code in 1 php file (e.g add_to_lead.php).
- put file project directory.
run file browser (e.g www.yourvtigerhost.com/add_to_lead.php)
$vtiger_utils_log = true; include_once('vtlib/vtiger/menu.php'); include_once('vtlib/vtiger/module.php'); $module = new vtiger_module(); $module = $module->getinstance('leads'); // create new block lead module , drop-down added new block $block1 = new vtiger_block(); $block1->label = 'lbl_lead_information'; $block1 = $block1->getinstance($block1->label,$module); $field0 = new vtiger_field(); $field0->name = 'your field name'; $field0->table = $module->basetable; $field0->label = 'your field name display'; $field0->column = 'field_name'; $field0->columntype = 'varchar(100)'; $field0->uitype = 15; $field0->setpicklistvalues( array ('dropdown value1','dropdown value2','dropdown value3')); $field0->typeofdata = 'v~o'; $block1->addfield($field0);
new dropdown have values dropdown value1,dropdown value2,dropdown value3
if want add more values dropdown can add setting-> studio->picklist editor.
Comments
Post a Comment