Integrate Sugar with external database

Hi everyone,

I need to connect Sugar CRM (v9) with an external database. Specifically, I want to react to the change of a field on the Contacts Module. Information of the changed record should then be transferred to another database. The remote database is only accessible via DBlink or direct login. Sugar DB and the remote DB are Oracle 19 DB's.

First thought was a trigger on the database (field level - Oracle PLSQL). But I would like to avoid that. I also don't really want to set up a scheduler.

Were there other approaches or best practice to reach this. Any ideas were very appreciated.

Thank you in advance!
Rene

Parents
  • Recomendation as per best practices is to configure a WebLogicHook after_save from Sugar to a layer at external DB.

    But if this is not an option so you can configure a custom db instace which points to external DB and send data from a LogicHook after_save.

    We have do that for SugarCRM MySQL to External Oracle and MySQL.

    The code may be something like that:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    $adapter = null;
    $driver_list = DBManagerFactory::getDbDrivers();
    dbconfig = array(
    'db_host_name' => 'external_db_hostname',
    'db_user_name' => 'external_db_user',
    'db_password' => 'external_db_password',
    'db_name' => 'external_db_name',
    'db_type' => 'external_db_type', // oci8
    );
    if(isset($driver_list[$dbconfig['db_type']])) {
    $adapter = $driver_list[$dbconfig['db_type']];
    $adapter->connect($dbconfig, false);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hi Andre,

    Is there a list of available db_type values somewhere?

    Thanks

Reply Children
  • Hello Polys,

    Nice to find you in the Club

    Probably the list of values depends on the list of drivers available https://support.sugarcrm.com/Knowledge_Base/Platform_Management/Determining_Which_Database_Sugar_is_Running/

    Please note, that according to Sugar Cloud Policy there is a restriction for Sugar Cloud instances, that "Outbound HTTP connections must have timeouts under 1 second."

    AFAIK, SugarCRM strongly suggests a middleware approach - before implementing outbound connections for production, I would suggest checking with Sugar Support whether limitations on other types of outbound connections for the Cloud instances.

    LBDataBridge webservice fits the recommendations as middleware for Sugar integrations.

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient