Hello,
I’m trying to modify the “Convert Target” Action in order to convert it to an Account instead of a Lead. I am following this post
I have created custom\modules\Accounts\controller.php
class AccountsController extends SugarController{
function AccountsController(){
parent::SugarController();
}
function pre_editview(){
//IF we have a prospect id convert it to an account
if (empty($this->bean->id) && !empty($_REQUEST['return_module']) &&$_REQUEST['return_module'] == 'Prospects' ) {
$prospect=new Prospect();
$prospect->retrieve($_REQUEST['return_id']);
foreach($prospect->field_defs as $key=>$value)
{
if ($key == 'id' or $key=='deleted' )continue;
if (isset($this->bean->field_defs[$key])) {
$this->bean->$key = $prospect->$key;
}
}
$_POST['is_converted']=true;
}
return true;
}
function action_editview(){
$this->view = 'edit';
return true;
}
}
I am wondering where, in the built in conversion to a lead, the id of the new Lead is set/map in the lead_id field of the Target and how it is then used to show on the lead’s detail view the link “Converted Leadt: lead_id”
Can anybody help me?
thanks in advanced
Rossella