Custom Module integration

I have created a custom module by the name of ā€œOrdersā€, i want leads to convert to orders rather than account/sales/contact.
however i have customized layout of my custom module and everything but when i convert leads to order it is not showing that i can convert it to orders but only showing contacts.
Kindly help do i need to make any setting which it will start giving the options to convert to orders.

Thanks and regards
Nitin

@nitinvashist01
You should do a lot of changes into files:

  • modules/Leads/metadata/convertdefs.php
  • modules/Leads/views/view.convertlead.php (function ā€˜handleSaveā€™)

May be some thing elseā€¦

I TRIED MAKING CHANGES BUT COULD NOT UNDERSTAND AS I DO NOT KNOW CODE.strong text

@nitinvashist01
Do you want that anybody do it for you for free? Itā€™s enough big work. People in community can show you a way. May be write small code.

I have added this code in * ā€œmodules/Leads/metadata/convertdefs.phpā€

$viewdefs['orders']['ConvertLead'] = array(
    'copyData' => true,
    'required' => true,
    'select' => "report_to_name",
    'default_action' => 'create',
    'templateMeta' => array(
        'form'=>array(
            'hidden'=>array(
                '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">',
                '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">',
                '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">',
                '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">',
                '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">'
            )
        ),
        'maxColumns' => '2',
        'widths' => array(
            array('label' => '10', 'field' => '30'),
            array('label' => '10', 'field' => '30'),
        ),
    ),
    'panels' =>array(
        'LNK_NEW_CONTACT' => array(
            array(
                array(
                    'name' => 'first_name',
                    'customCode' => '{html_options name="Contactssalutation" options=$fields.salutation.options selected=$fields.salutation.value}&nbsp;<input name="Contactsfirst_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
                ),
                'title',
            ),
            array(
                'last_name',
                'department',
            ),
            array(
                array('name' => 'primary_address_street', 'label' => 'LBL_PRIMARY_ADDRESS'),
                'phone_work',
            ),
            array(
                array('name'=>'primary_address_city', 'label' => 'LBL_CITY'),
                'phone_mobile',
            ),
            array(
                array('name'=>'primary_address_state', 'label' => 'LBL_STATE'),
                'phone_other',
            ),
            array(
                array('name'=>'primary_address_postalcode', 'label' => 'LBL_POSTAL_CODE'),
                'phone_fax',
            ),
            array(
                array('name'=>'primary_address_country', 'label' => 'LBL_COUNTRY'),
                'lead_source',
            ),
            array(
                'email1',

            ),
            array(
                'description'
            ),
        )
    ),
);

@nitinvashist01
For start:

  1. Do you sure that name of module ā€˜ordersā€™ the first symbol writing in lower cases?
  2. Do you have the field ā€˜report_to_nameā€™ in module ā€˜ordersā€™ which do relate to other record of module ā€˜ordersā€™? (look at two fields ā€˜report_to_nameā€™ and ā€˜reports_to_idā€™ of module ā€˜Contactsā€™ or two fields ā€˜account_nameā€™ and ā€˜account_idā€™ of module ā€˜Accountsā€™.
  3. Do you have all field which present in the panel ā€˜LNK_NEW_CONTACTā€™ and the array ā€˜hiddenā€™ in module ā€˜ordersā€™?