~~NOTOC~~
====== Business Mapping:: Contacts2Accounts ======
---- dataentry ----
name : Contacts2Accounts
type : businessmapping
bmtype : Field Mapping
description_wiki: Convert a Contact into an Account
keywords_tags : contact,account,conversion
version : 1.0
release_dt : 2016-05-01
licenses : MPL
price : Free
distribution : Free
authorname : JPL TSolucio, S.L.
authoremail_mail : info(at)tsolucio(dot)com
supportemail_mail : info(at)tsolucio(dot)com
----
\\
This script will add the "converted from" field present in the mapping and the action link on Contacts.
name = 'converted_from';
$field->label= 'Converted From';
$field->table = $module->basetable;
$field->column = 'converted_from';
$field->columntype = 'INT(11)';
$field->uitype = 10;
$field->displaytype = 1;
$field->typeofdata = 'I~O';
$field->presence = 0;
$blockInstance->addField($field);
$field->setRelatedModules(Array('Contacts'));
echo "
Added Field to ".$module->name." module.
";
} else {
echo "Failed to find ".$module->name." block
";
}
} else {
echo "Failed to find ".$module->name." module.
";
}
$module = Vtiger_Module::getInstance('Contacts');
if($module) {
$module->addLink('DETAILVIEWBASIC','Convert to Account','index.php?module=Accounts&action=EditView&cbfromid=$RECORD$');
} else {
echo "Failed to find ".$module->name." module.
";
}
?>