How to autopopulate a field in SugarCRM form

一个人想着一个人 提交于 2019-12-24 00:58:36

问题


We have not yet customized SugarCRM 6 but here's our first issue.

When we are browsing a Contact's record, under the "Activities" subpanel, we can create a new meeting by clicking on "Create Meeting". Then, a quick form appears and the Account field (parent_name) is autopopulated with the Contact's associated Account name.

My question: how to modify that and autopopulate the parent_name with the Contact's name instead, so that the Meeting will be link to the Contact's record and not the Account's record.

Thanks !

Alex


回答1:


Hi I believe you should be looking at /modules/Meeting/MettingFormBase.php

Copy this to custom/modules/Meeting/ of course.

Look about line 73; $default_parent_type= $app_list_strings['record_type_default_key']; and line 83; <input type="hidden" name="${prefix}parent_type" value="${default_parent_type}">

This could be changed something like; if($_REQUEST['module'] == 'Contacts'){ $default_parent_type = 'Contacts; }else{ '$app_list_strings['record_type_default_key']; }

Code is not tested but hopefully it will point you in the correct direction.



来源:https://stackoverflow.com/questions/5807448/how-to-autopopulate-a-field-in-sugarcrm-form

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!