出于某种原因,我的代码正在生成 module=undefined:
/index.php?module=undefined&action=Popup&html=Popup_picker&form=vtlibPopupView&forfield=Quotes&srcmodule=Leads&forrecord=1695
问题是我直接在我的脚本中定义了模块:
$field0->setRelatedModules(Array('Quotes'));
我在这里做错了什么?
这是我的完整代码:
$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
//(module name without space)
$module = Vtiger_Module::getInstance('Leads');
$module->initWebservice();
// Create Block instance
$block1 = new Vtiger_Block();
$block1 = Vtiger_Block::getInstance('LBL_LEAD_INFORMATION', $module);
$field0 = new Vtiger_Field();
$field0->name = 'quotes';
$field0->column = 'quotes';
$field0->label = 'Test2';
$field0->uitype = 10;
$field0->typeofdata = 'V~O';
//$field0->setRelatedModules(Array('Quotes'));
$field0->setRelatedModules(Array('quotes'));
$block1->addField($field0);