Advice Requested: Working on being able to convert a lead into a custom module

We are developing a very customized, non-standard CRM in terms of the way CRM’s are designed to work.

One of the things I’m about to begin working on is the ability to convert a Lead into a custom module. The conversion process will also trigger a Logic hook that can potentially create up to 12 other records as well.

Not only that, but the way SuiteCRM converts Leads into Contacts is way more in-depth that we need it to be. There will be no fields that appear when they hit convert. They just need to hit a button and be able to convert the Lead into either an ‘Investor Contact’ (The default contacts module), or our custom made (Contracted Reps) module. And then confirm that.

The advice I am asking for is about:

A) Where all the files are that control the conversion process and what’s displayed, etc…
B) How to trigger the Business Logic Hook off of the conversion process and be able to grab the Lead page Information
C) Anything else you think would help

In the meantime, I will be investigating all of this myself.

Thanks!

Hi,
if i must what you need; i do so.

add new button to Lead
-> custom/leads/metadata/detailviewdefs.php
if converted, disable button. like so


 13 => 
          array (
            'customCode' => '{if ( $fields.converted=false or ? .....

create a custom controller :
custom/leads/controller.php

get bean
create new bean (custom module)
save new bean with all data of lead and get id
change status of bean to converted
save.
load relationship
create other bean
save it and get id
add relationship with id


class CustomLeadsController extends SugarController { 

	function action_ConvertMe(){
		global $db;
        global $current_user;
        global $timedate;
		
		$Lead = BeanFactory::getBean('Leads', $this->bean->id);
                $newww = BeanFactory::newBean('MyModule');
                copy all from lead to newww
                 $id = $newww->save(false);
                $newww->load_relationship('dothermodule');
		$newww-> dothermodule->add( otherid);

What if I just want my custom module to show up as on of the options on the lead conversion screen? i.e. not a seperate button, but an extra module with checkbox, that I can opt in to create in the lead conversion process (while taking over data from lead dataset as long as the field name is exactly the same). analogous to the core options:

Create Contact or Select Contact
Create Account or Select Account
Create Opportunity
Create Note
Log Call
Schedule Meeting
Create Task

-> add “Create [Custom Module Dataset]”

I plan on publishing a guide on how to do exactly that. I did discover how to do that. Stay tuned and I will post a link here shortly. (within the next day or do)

1 Like