sugarcrm: run java script from custom logic hook

    <?php if(!defined(‘sugarEntry’) || !sugarEntry) die(‘Not A Valid Entry Point’); class idempiere_sync { function idempiere_sync(&$bean, $event, $arguments) { require_once(‘log4php/LoggerManager.php’); $JAVA_HOME = “/usr/lib/jvm/java-8-openjdk-amd64”; $PATH = “$JAVA_HOME/bin:/usr/local/bin:/usr/bin:/bin”; putenv(“JAVA_HOME=$JAVA_HOME”); putenv(“PATH=$PATH”); $output = shell_exec(‘/home/Scripts/talend/iDempiere/SugarCRM/CRM_iDempiere/CRM_iDempiere_run.sh’); echo $output; } } ?>

sugarcrm: delete custom field

You have to check for following things. 1) Remove custom field entry in table “fields_meta_data” 2) Remove field from module_name_cstm table 2) Remove file from custom/extension/modules/<Yourmodule>/Ext/Vardefs/sugarfield_<Field name>.php 3) Remove field from all the view if you have added any.   […]

sugarcrm: mysql query update contacts

Query 1 Adds Vendedor = 1 To All Contacts that are Joined to a Manufacturer     UPDATE contacts INNER JOIN a26_proveedor_contacts_c ON contacts.id = a26_proveedor_contacts_c.a26_proveedor_contactscontacts_idb INNER JOIN contacts_cstm ON contacts.id = contacts_cstm.id_c SET contacts_cstm.vendedor_c = 1   Query 2 […]

sugarcrm: imap setting

Requirements: – Mail server needs on SugarCRM needs– Inbound Email cannot function without the IMAP c-client libraries enabled/compiled with the PHP module. Please contact your administrator to resolve this issue.

mysql: assign opportunities to user based on parent account

Query to Select List:   SELECT * FROM opportunities LEFT JOIN accounts_opportunities ON accounts_opportunities.opportunity_id = opportunities.id LEFT JOIN accounts ON accounts_opportunities.account_id = accounts.id WHERE accounts.assigned_user_id = ‘7077c616-4f2c-f966-d9b6-5581807bae86’;     UPDATE Query: UPDATE opportunities x LEFT JOIN accounts_opportunities y ON y.opportunity_id […]