Converting Leads with custom fields, then how to copy the Leads custom fields into the new Accounts?

Hi to all,
I have created 4 new custom fields for the Leads:

  1. text area
  2. integer
  3. frop down
  4. text field
    all of them need to be ported to the account created from the conversion of the leads.
    How to make possible to copy the leads custom fields into the accounts created from the conversion of these leads?

Hello,

If you will have same field name in Accounts module as the Leads. It will automatically carry forward this field to Accounts module.

Thansk for the answer, but I still have the same issue, please read here:
https://suitecrm.com/forum/suitecrm-7-0-discussion/13622-how-to-have-the-fields-industry-and-type-of-clients-in-the-leads-too#45658
(sorry for mistake, I was doubling this topic in the forum)

Use this where you have created a custom field within Leads module and you want to be able to map that field to a standard field in Accounts, or where you have custom fields in each module with mismatched names.

1 - Create a Copy of /modules/Leads/views/view.convertlead.php in custom/modules/Leads/views/ // Keep things upgrade safe :wink:
2 - Edit you copy in /custom directy

Within protected function handleSave() // Starts at line 352

Below this snippet :


451 $this->populateNewBean($module, $beans[$module], $beans['Contacts'], $lead);
452 // when creating a new contact, create the id for linking with other modules
453 // and do not populate it with lead's old account_id
454 if ($module == 'Contacts')
455 {
456        $beans[$module]->id = create_guid();
457        $beans[$module]->new_with_id = true;
458        $beans[$module]->account_id = '';
459  }

 // Insert your code from here ( i.e line 460 ) put something like this
 // Below you can use mapping against standard modules, to custom lead fields as follows
 if ($module == 'Accounts')
  {
      // Here I Map custom wfs_industry_c ( a dropdown field, which uses industry_dom, as does Accounts )
      // These mappings operate in the background, so you will not see these fields in the Convert UI
      // Also NOTE: This modification is not necessary if your Account field and Lead field have the identical name,
      // as that is taken care of automatically.
      // See also
      $beans[$module]->industry = $lead->wfs_industry_c;
   }

Hope you find this useful

1 Like

Thanks ricktimmis