I have created a custom field.
$field4 = new Vtiger_Field();
$field4->name = 'PriceBook';
$field4->label= 'Price Book';
$field4->table = 'vtiger_account';
$field4->column = 'pricebook_id';
$field4->columntype = 'VARCHAR(100)';
$field4->uitype = 10;
$field4->typeofdata = 'V~O';
$field4->helpinfo = 'Relate to an existing contact';
$block->addField($field4);
$field4->setRelatedModules(Array('PriceBooks'));
But this field doesn't submit any value to the database. what am I missing here.
Please check vtiger_account table in Database and check column pricebook_id exists in table. if not use the following code
// Turn on debugging level
$Vtiger_Utils_Log = true;
include_once 'includes/Loader.php';
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
$db = PearDatabase::getInstance();
$db->pquery("ALTER TABLE `vtiger_account` ADD COLUMN `pricebook_id` VARCHAR(100) NULL ;", array());