// delete from mapping table
$mapping = new CRM_Core_DAO_Mapping();
$mapping->id = $id;
- $mapping->delete();
- CRM_Core_Session::setStatus(ts('Selected mapping has been deleted successfully.'), ts('Deleted'), 'success');
-
- return TRUE;
+ if ($mapping->find(TRUE)) {
+ $result = $mapping->delete();
+ CRM_Core_Session::setStatus(ts('Selected mapping has been deleted successfully.'), ts('Deleted'), 'success');
+ return $result;
+ }
+ return FALSE;
}
/**
),
),
'CRM_Core_DAO_MappingField' => array(
- array(
- 'fieldName' => 'contact_type',
- 'sample' => 'Individual',
- ),
array(
'fieldName' => 'website_type_id',
'sample' => 'Facebook',
$this->useTransaction(TRUE);
$this->_entity = 'mapping_field';
- $this->_mappingID = $this->mappingCreate();
+ $mappingID = $this->mappingCreate();
$this->params = array(
- 'mapping_id' => $this->_mappingID,
+ 'mapping_id' => $mappingID->id,
'name' => 'last_name',
'contact_type' => 'Individual',
'column_number' => 2,