Results 1 to 10 of 10

Thread: ConvertLead - Make Appointment box auto fill with ACCOUNT

  1. #1
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default ConvertLead - Make Appointment box auto fill with ACCOUNT

    Hello

    Using Sugar 5.5

    I have already applied the steps below to Sugar and they work fine-

    But I need to still figure out how to make:

    1. Auto Fill the Appointment Box with the Accout Info during the ConvertLead process
    2. Change the default radio button from "Call" to "Meeting" for Appointment during the ConvertLead process

    I have been trying for days to figure this out, I have tried to modify the CallFormBase.PHP, MeetingFormBase.PHP, and ConvertLead.PHP in several places but I gues I just havent found the magic spot yet. Can you help me figure this one out ?


    Here is what I have done so far.....

    1. Make the "Create Opportunity" and “Create Appointment” box always checked :
    In the Leads/ConvertLead.php file
    change the following text bolded items at the bottom of your php file:

    Located here
    //OPPORTUNITY
    .....('FORMBODY',"<h5 class='dataLabel'><input class='checkbox' type='checkbox' name='newopportunity' onClick='toggleDisplay(\"newoppdiv\");'> ".$mod_strings['LNK_NEW_OPPORTUNITY']."</h5><div id='newoppdiv' style='display:none'>".$oppForm->getWideFormBody('Opportunities', 'Opportunities','ConvertLead', $lead , false).....

    New Code Is

    .....('FORMBODY',"<h5 class='dataLabel'><input class='checkbox' type='checkbox' checked name='newopportunity' onClick='toggleDisplay(\"newoppdiv\");'> ".$mod_strings['LNK_NEW_OPPORTUNITY']."</h5><div id='newoppdiv' style='display:block'>".$oppForm->getWideFormBody('Opportunities', 'Opportunities','ConvertLead', $lead , false).....


    And

    //APPOINTMENT
    .....('FORMBODY',"<h5 class='dataLabel'><input class='checkbox' type='checkbox' checked name='newmeeting' onClick='toggleDisplay(\"newmeetingdiv\");'> ".$mod_strings['LNK_NEW_APPOINTMENT']."</h5><div id='newmeetingdiv' style='display:block'>".$callForm->getWideFormBody('Appointments','Calls','Convert Le ad').....



    2. Make Expected Close Date Not required :
    In Opportunities/OpputunityFormBase.php under the function getWideFormBody()
    check for the line :
    <td class="dataLabel">$lbl_date_closed&nbsp;<span class="required">$lbl_required_symbol</span></td>
    change this to -
    <td class="dataLabel">$lbl_date_closed&nbsp;

    And
    also, in the Opportunities/metadata/editviewdefs.php, in the "panels" array remove 'required'=>true' for the "date_closed" –

    old code: array('name'=>'date_closed', 'displayParams'=>array('required'=>true)),
    new code: array('name'=>'date_closed', 'displayParams'=>array()),


    3. Prefill the Opportunity name with the Account Name :
    In Opportunities/OpputunityFormBase.php under the function getWideFormBody()
    check for the line:
    <td class="dataField"><input name='{$prefix}name' type="text" value="{$lead->opportunity_name}"></td>
    change it to:
    <td class="dataField"><input name='{$prefix}name' type="text" value="{$lead->account_name}"></td>

  2. #2
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Lightbulb Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    I figured out how to change the default radio buttons for the appointment from Call to Meeting finally

    Now the only item left is to auto populate the subject text area.

    Can anyone help me figure this out? I am still trying but most likely I am working on the wrong php file code.


    Your help is greatly appreciated,
    Jeff

  3. #3
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    To Change the Default Radio Buttom from "Call" to "Meeting" during ConvertLead

    Edit CallFormBase.PHP in 3 places at \htdocs\sugarsuite\modules\Calls

    EDIT HERE... at around 60 lines under the class CallFormBase{ section


    <tr>
    <td colspan="2"><input type='radio' name='appointment' value='Call' class='radio'

    onchange='document.${formname}.module.value="Calls ";' style='vertical-align: middle;'><span scope="row">${mod_strings

    ['LNK_NEW_CALL']}</span>
    &nbsp;
    &nbsp;
    <input type='radio' name='appointment' value='Meeting' class='radio' onchange='document.${formname}.module.value="Meeti ngs";'

    checked><span scope="row">${mod_strings['LNK_NEW_MEETING']}</span></td>
    </tr>


    AND EDIT HERE...towards the bottom of the page

    EOQ;

    if($wide){
    $form .= <<<EOQ
    <td scope='row' width="20%"><input type='radio' name='appointment' value='Call' class='radio'> ${mod_strings['LNK_NEW_CALL']}

    </td>
    <td scope='row' width="80%">${mod_strings['LBL_DESCRIPTION']}</td>
    </tr>

    <tr>
    <td scope='row'><input type='radio' name='appointment' value='Meeting' class='radio' checked> ${mod_strings['LNK_NEW_MEETING']}

    </td>


    AND HERE...

    }else{
    $form .= <<<EOQ
    <td scope='row' width="20%"><input type='radio' name='appointment' value='Call' class='radio'

    onchange='document.$formname.module.value="Calls"; '> ${mod_strings['LNK_NEW_CALL']}</td>
    </tr>

    <tr>
    <td scope='row'><input type='radio' name='appointment' value='Meeting' class='radio'

    onchange='document.$formname.module.value="Meeting s";' checked> ${mod_strings['LNK_NEW_MEETING']}</td>
    </tr>


    Can Anyone help me with the Auto Populate Appontment with Account info for the Subject Box please

    Thank you
    Jeff

  4. #4
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    Can anyone help?

    I need to Auto Fill the Appointment Subject Box during the ConvertLead process

    I tried to add/change this into the CallFormBase.PHP, MeetingFormBase.PHP files
    input name='{$prefix}name' type="text" value="{$lead->account_name}

    But it will not work so there has to be something else in the code that needs to be set/changed. Why did this code work for the opportunity box but not on the appointment box?

    Sincerely appreciative to your help
    Jeff

  5. #5
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    It is not clear for me.
    Also, what you mean Appointment in SugarCRM?
    Wich version of SugarCRM do you use?
    Letrium ltd. - Only high quality service
    http://letrium.com

  6. #6
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    Thanks

    Sugar 5.5

    When you click on Convert Lead it goes to a new page where the Contact, Account, Opportunity, and Appointment is created.

    At the bottom of the page where the APPOINTMENT is you can select Call and Meeting and then select a Subject name for the meeting

    I need to auto populate the ACCOUNT name into the SUBJECT box. The same solution that I used to auto fill the opportunity box does not work when I modify the php files in the CALL and MEETING directories.

    Any help you can lend would be greatly appreciated
    Jeff

  7. #7
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    Hello,

    For Account:
    You just need to customize ../modules/Accounts/AccountFormBase.php
    function getWideFormBody()

    For Appointment:
    ../modules/Calls/CallFormBase.php
    function getWideFormBody()
    Letrium ltd. - Only high quality service
    http://letrium.com

  8. #8
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    Hello and thanks for your help-

    I have added the input type of "account_name" into GetWideFormBody and
    also changed the input value of $lbl_subject to "$lead->account_name" in the file

    It still will not work when I relog in a try the convert lead

    can you help me figure out what exactly needs to be done so the account_name will populate?

    Here is what is did to the CallFormBase.PHP file so far

    $form = <<<EOQ
    <input type="hidden" name="${prefix}direction" value="Outbound">
    <input type="hidden" name="${prefix}record" value="">
    <input type="hidden" name="{$prefix}account_name">
    <input type="hidden" name="${prefix}status" value="${default_status}">
    <input type="hidden" name="${prefix}parent_type" value="${default_parent_type}">
    <input type="hidden" name="${prefix}assigned_user_id" value='${user_id}'>
    <input type="hidden" name="${prefix}duration_hours" value="1">
    <input type="hidden" name="${prefix}duration_minutes" value="0">
    <input type="hidden" name="${prefix}user_id" value="${user_id}">

    <table cellspacing='0' cellpadding='0' border='0' width="100%">
    <tr>
    EOQ;


    <tr>
    <td scope='row'>$lbl_subject&nbsp;<span class="required">$lbl_required_symbol</span></td>
    </tr>

    <tr>
    <td ><input name='{$prefix}name' type="text" value="{$lead->account_name}"></td>
    </tr>

  9. #9
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    Add this lines into CallFormBase.php
    PHP Code:
    require_once('modules/Leads/Lead.php');
    $lead = new Lead(); 
    $lead->retrieve($_REQUEST['record']); 
    For example:

    PHP Code:
    ..
    require_once(
    'modules/Leads/Lead.php');
    $lead = new Lead(); 
    $lead->retrieve($_REQUEST['record']);

    $form = <<<EOQ
    <input type="hidden" name="${prefix}direction" value="Outbound">
    <input type="hidden" name="
    ${prefix}record" value="">
    <input type="hidden" name="
    {$prefix}account_name">
    <input type="hidden" name="
    ${prefix}status" value="${default_status}">
    <input type="hidden" name="
    ${prefix}parent_type" value="${default_parent_type}">
    <input type="hidden" name="
    ${prefix}assigned_user_id" value='${user_id}'>
    <input type="hidden" name="
    ${prefix}duration_hours" value="1">
    <input type="hidden" name="
    ${prefix}duration_minutes" value="0">
    <input type="hidden" name="
    ${prefix}user_id" value="${user_id}">

    <table cellspacing='0' cellpadding='0' border='0' width="100%">
    <tr>
    EOQ;
    ... 
    Letrium ltd. - Only high quality service
    http://letrium.com

  10. #10
    jrp918 is offline Senior Member
    Join Date
    Aug 2010
    Location
    Phoenix Arizona
    Posts
    27

    Default Re: ConvertLead - Make Appointment box auto fill with ACCOUNT

    That did it...

    Thank you so much for helping me on this !
    Have a great week!

    Sincerely,
    Jeff
    Phoenix Arizona

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 12
    Last Post: 2011-07-12, 10:54 AM
  2. Auto fill name
    By anjireddy987 in forum Developer Tutorials
    Replies: 1
    Last Post: 2010-04-06, 06:51 AM
  3. Make Create Appointment required and default?
    By rampar in forum Developer Help
    Replies: 1
    Last Post: 2009-05-16, 04:05 PM
  4. Replies: 2
    Last Post: 2008-02-11, 05:15 AM
  5. Replies: 2
    Last Post: 2007-06-14, 06:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •