Skip to content

Instantly share code, notes, and snippets.

/**
* Returns an array of indices for the current module
*
* @return array
*/
private function _getIndexVardefs()
{
$indexes = $this->_focus->getIndices();
if ( $this->_focus->getFieldDefinition('email1') )
<?php
$dictionary['Contact']['indices'][] = array(
'name' => 'special_idx_first_last_email',
'type' => 'index',
'source' => 'non-db',
'fields' => array('first_name','last_name','email1')
);
<?php
$sea = new SugarEmailAddress;
// Add a primary email address
$sea->addAddress($primaryemailaddress, true);
// Add an invalid email address
$sea->addAddress($primaryemailaddress, false, null, true);
// Add an email address that should be marked opt-out
$sea->addAddress($primaryemailaddress, false, null, false, true);
<?php
$sea = new SugarEmailAddress;
// Grab the primary address for the given record represented by the $bean object
$primary = $sea->getPrimaryAddress($bean);
<?php
$sea = new SugarEmailAddress;
// Grab the array of addresses
$addresses = $sea->getAddressesByGUID($id, $module);
foreach ( $addresses as $address ) {
echo $address->email_address . "\n";
}
<?php
//To get ID
$FollowUpMeeting->save();
if( $FollowUpMeeting->parent_type == 'Contacts' && !empty($FollowUpMeeting->parent_id) )
{
//Get the current person
$person = new Contact();
<?php
$layout_defs['<modulename>']['subpanel_setup']['<modulename to block>'] = array ();
?>
<?php
class CustomModuleViewDetail extends ModuleViewDetail
{
public function __construct()
{
parent::ViewDetail()
$this->options['show_subpanels'] = false;
}
}
'generate_select' => true,
'function_parameters' => array('return_as_array' => 'true'),
<?php
$layout_defs['Accounts']['subpanel_setup']['custom_meetings'] = array(
'order' => 10,
'sort_order' => 'desc',
'sort_by' => 'date_start',
'title_key' => 'LBL_MEETINGS_SUBPANEL_TITLE',
'subpanel_name' => 'custom_meetings', // not a real file name because
'type' => 'collection', // this is a collection
'module' => 'Meetings',