Autofill related to filed in calls module sub-panel of contacts module.

Here’s an example.

I’m on a contact record named “Alex”.

I click Activities module to log the call from the contact record. Instead of the call being related to the contact, it’s related to the Accounts the contact works for.

Can we default select the contact module for relate-to filed in call module? Now by default account is selected in log call how could I achieve by default
contacts module selected for subpanel call module relate to field.

Is there a way to fix this?

Please if anyone has the answer.

Hi,
you can modify “parent_type_display” drop-down options and can move the Contact at first.
Second solution is to use JavaScript to select the contact on page load event.

Thanks

Sohaib Majeed
SuiteCRM Developer
Upwork

Hello,
Thanks for the reply.
I have done that but that is only for the time when I am not using call activities from the subpanel. I need this one implement on contacts subpanel. Is this possible or not?

Yes this is possible
Custom coding will be required.
Thanks

Hi,

I have write code for you after spending almost half hour.

Please go to

modules\Calls\metadata

and find

quickcreatedefs.php

and add the following line in includes array

1 => array(‘file’ => ‘modules/Calls/script.php’),

so the code should look

               'includes' => array(
                    0 => array('file' => 'modules/Reminders/Reminders.js'),
                    1 => array('file' => 'modules/Calls/script.php'),
                ),

and then create the file script.php in the modules\Calls folder and add the following code in this file

<?php if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); /* * ******************************************************************************* * SugarCRM Community Edition is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. * Copyright (C) 2011 - 2014 Salesagility Ltd. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not * reasonably feasible for technical reasons, the Appropriate Legal Notices must * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". * */ ?>

and then Repair and Rebuild the CRM. The issue will be fixed for Contacts Module

Thanks (in case of any issue please contact me at skype sohaib.majeed44 and show me the code)

Sohaib Majeed
SuiteCRM Developer
Upwork

1 Like

Thanks for the reply.

I have done the same thing what you have mentioned here but it is not working for me. When I implemented this code my calls quick create form not displayed.

have you repaired the system?

Yes, I have repaired the system.

can you show me the files on Skype? sohaib.majeed44

I can send you the screenshot here if it is ok.

yes sure

please share the both files.

<?php $viewdefs ['Calls'] = array ( 'QuickCreate' => array ( 'templateMeta' => array ( 'includes' => array ( 0 => array ( 'file' => 'modules/Reminders/Reminders.js', ), 1 => array ( 'file' => 'modules/Calls/script.php', ), ), 'maxColumns' => '2', 'form' => array ( 'hidden' => array ( 0 => '', 1 => '', 2 => '', 3 => '', 4 => '', ), 'buttons' => array ( 0 => array ( 'customCode' => '', ), 1 => 'CANCEL', 2 => array ( 'customCode' => '', ), 3 => array ( 'customCode' => '{if $fields.status.value != "Held"}{/if}', ), ), ), 'widths' => array ( 0 => array ( 'label' => '10', 'field' => '30', ), 1 => array ( 'label' => '10', 'field' => '30', ), ), 'javascript' => '{sugar_getscript file="cache/include/javascript/sugar_grp_jsolait.js"}', 'useTabs' => false, 'tabDefs' => array ( 'DEFAULT' => array ( 'newTab' => false, 'panelDefault' => 'expanded', ), ), ), 'panels' => array ( 'default' => array ( 0 => array ( 0 => array ( 'name' => 'name', 'displayParams' => array ( 'required' => true, ), ), 1 => array ( 'name' => 'status', 'displayParams' => array ( 'required' => true, ), 'fields' => array ( 0 => array ( 'name' => 'direction', ), 1 => array ( 'name' => 'status', ), ), ), ), 1 => array ( 0 => array ( 'name' => 'date_start', 'type' => 'datetimecombo', 'displayParams' => array ( 'required' => true, 'updateCallback' => 'SugarWidgetScheduler.update_time();', ), 'label' => 'LBL_DATE_TIME', ), 1 => array ( 'name' => 'parent_name', 'label' => 'LBL_LIST_RELATED_TO', ), ), 2 => array ( 0 => array ( 'name' => 'duration_hours', 'label' => 'LBL_DURATION', 'customCode' => '{literal}{/literal}{$fields.duration_minutes.value} {$MOD.LBL_HOURS_MINUTES}', 'displayParams' => array ( 'required' => true, ), ), 1 => array ( 'name' => 'call_medium_c', 'studio' => 'visible', 'label' => 'LBL_CALL_MEDIUM', ), ), 3 => array ( 0 => array ( 'name' => 'reminders', 'customCode' => '{include file="modules/Reminders/tpls/reminders.tpl"}', 'label' => 'LBL_REMINDERS', ), ), ), ), ), ); ?>

quickcreatedefs.php file code

<?php if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); /* * ******************************************************************************* * SugarCRM Community Edition is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. * Copyright (C) 2011 - 2014 Salesagility Ltd. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not * reasonably feasible for technical reasons, the Appropriate Legal Notices must * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". * */ ?>

script.php file code . Sorry not able to upload screenshot so i have sended my code here.

The code looks OK. Can you please check the logs?
and system console. I have checked in the fresh installation and it is working here…

Thanks

I am sorry, if you show me the CRM i can help. I have done as much as i can.

Thanks

ok, let me check if I will get something from there I will respond to you.
Thanks for the help.

You are welcome

Hello, I have done that with some modification with code. But I also need that contacts name should appear on the box which is next to “related to” the field.