- Code way:
1. Use metadata/popupdefs.php (custom folder, if there is none copy original)
2. Seek section searchdefs' => array(…)
3. Add field to searchdefs
- Studio way:
Admin > Studio > Contacts > Layouts > PopupView > Popup Search
Subpanel Query Change with custom fields
1. Open subpanel def
2. Use ‘where’ clause
3. Query mysql like “contacts.id in ( select id_c from contacts_cstm where contact_roles_c ='past' )”
If this fails, remember this:
- Sugar will make a mess of your subquery. There’s an easy solution. Sugar handles query rewriting based on the strings “where” or “WHERE”. So, all you need to do is write your “WHERE” in mixed case, like so: "where" = "id in (select id from some_table WhErE field='xyz')"
1. Edit the file custom/Extension/modules/<CustomModule>/Ext/Layoutdefs/<filename>
2. Replace the top_button "SubPanelTopCreateButton" by "SubPanelTopButtonQuickCreate"(or your button)
3. Go to Admin -> Repair -> Rebuild Extensions
- create a file in custom/modules/{MODULE}/ called "controller.php".
- Here is an example of a custom controller.php
<?php
class CustomContactsController extends SugarController{
public function action_MyActionName(){
$record = $_REQUEST['record'];
//do something with the record here
}
}
- In this function you have access to the entire SugarCRM API. You can create and update Sugar Beans, or run queries directly on the database, using the global "$db" object.
You would need to add a view.edit.php file
in each module you want to use your template, overriding the preDisplay()
method like so:
PHP Code:
function preDisplay()
{
parent::preDisplay();
$this->ev->tpl = 'yourtplfile.tpl';
}
- Create subpanel LAyout File in modules/subpanels/metadata For instance "ForEvents";
- Then go to module Layout definition:
- /custom/Ext/Layoutdefs/layoutdefs.ext.php
- Change Subpanel name to your PanelDefinitionfilename for instance "ForEvents"
- link
- next if clause find -> $limit = $sugarconfig….records per page Replace with:
- PHP Code:
if ($subpanel_def->_instance_properties['records_per_page']) {
$limit = $subpanel_def->_instance_properties['records_per_page'] + 0;
} else {
$limit = $sugar_config['list_max_entries_per_subpanel'];
}
Custom<module>ViewEdit extends <module>ViewEdit
$GLOBALS['log']->error("handling contat= ". print_r($ListContact, true));
- admin > system settings > display actions within menus > uncheck
// Display a message to the user before the action
ajaxStatus.showStatus('Message to display while doing the action');
ajaxStatus.hideStatus();
// Show Loadingscreen AJAXUI
SUGAR.ajaxUI.showLoadingPanel();
SUGAR.ajaxUI.hideLoadingPanel();