0

I created new block and add new fields in that block. Now i want to delete that block and fields of that block. below code i used to create block and fields.

// Create Block instance
$servicesModule = Vtiger_Module::getInstance('Accounts');
$blockInstance = new Vtiger_Block();
$blockInstance->label = 'Select Buiness Unit';
$servicesModule->addBlock($blockInstance);

$field = new Vtiger_Field();
$field->name = 'Business_Unit';
$field->label = 'Business_Unit';
$field->table = 'vtiger_account';
$field->column = 'business_unit_id';
$field->columntype = 'VARCHAR(100)';
$field->uitype = 10;
$field->typeofdata = 'V~O';
$field->helpinfo = 'Related to an existing business_unit';
$blockInstance->addField($field);
$field->setRelatedModules(array('Business_Unit'));

1 Answers1

0

Search at vtiger_blocks and vtiger_field tables the records with that labels and delete it.

psauleda
  • 60
  • 5