12-20-2016, 06:48 AM
I tried the following code to add a "101" field to SalesOrder:
This worked, but gave me the following error:
Does anyone know what went wrong? As said, the field was created.
PHP Code:
include_once('vtlib/Vtiger/Module.php');
$module = Vtiger_Module::getInstance('SalesOrder');
$blockInstance = Vtiger_Block::getInstance('LBL_SO_INFORMATION', $module);
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = 'reports_to_id';
$fieldInstance->table = 'vtiger_salesorder';
$fieldInstance->column = 'executing_user_id';
$fieldInstance->columntype = 'INT(11)';
$fieldInstance->uitype = 101;
$fieldInstance->typeofdata = 'V~O';
$blockInstance->addField($fieldInstance);
This worked, but gave me the following error:
PHP Code:
Catchable fatal error: Object of class Vtiger_Module could not be converted to string in index.php on line 687
Does anyone know what went wrong? As said, the field was created.