Knowledge.ToString()

Make the Account or Contact Optional When Converting a Lead in SuiteCRM

If you want to use SuiteCRM in a way that is slight different from out of the box functionality, it is sometimes difficult to find the guidance online and requires code digging in order to find the solution. By default, when you are converting a Lead, you must create a Contact and Account. If your business process does not need either one, you need to make the following change to the code.

  1. Go to your SuiteCRM_ROOT/modules/Leads/metadata
  2. Open convertdefs.php in your text editor.
  3. If you want to make Contact as optional, go to approximately Line 40 where you will see a code for “$viewdefs[‘Contacts’][‘ConvertLead’]”. On Line 42, change “‘required’ => true,” to “‘required’ => false,” and you are done.
  4. If you want to make Account as optional, go to approximately Line 104 where you will see a code for “$viewdefs[‘Accounts’][‘ConvertLead’]”. On Line 106, change “‘required’ => true,” to “‘required’ => false,” and you are done.

Please note that this method is not upgrade safe. As soon as you upgrade it, it will wipe our your changes.

Share

Comments

5 responses to “Make the Account or Contact Optional When Converting a Lead in SuiteCRM”

  1. Thomas Avatar
    Thomas

    Hello Vishal,
    great information. Thank you very much therefor.

    But we still have the problem when we are importing contacts. Then an account is created for every contact.
    Do you have a solution for that also?

    Kind Regards,
    Thomas

    1. Vishal Monpara Avatar
      Vishal Monpara

      Hello Thomas,

      I don’t know the solution but I assume that if you remove the account information from contact before importing, it will not create accounts.

      Thank you
      Vishal Monpara

  2. Mustafa Taheri Avatar
    Mustafa Taheri

    It’s creating a blank contact in Contacts Module

    1. Vishal Monpara Avatar
      Vishal Monpara

      Hi Mustafa,

      You are right. It creates a contact with email address and phone number without name.

      Regards,
      Vishal Monpara

    2. Ajay Verma Avatar
      Ajay Verma

      For preventing blank account creation after lead conversion…

      Go to ROOT/cache/themes/SuiteP/modules/Accounts/ConvertLead.tpl

      and change

      document.getElementById(‘newAccounts’).checked = true;

      to

      document.getElementById(‘newAccounts’).checked = false;

      Note: Your changes will be wiped if you update the SuiteCRM setup.

Leave a Reply

Your email address will not be published. Required fields are marked *