[Drupal] Learn how to integrate SugarCRM with Drupal

| | 3 min read

SugarCRM is a popular open source CRM software. We had integrated data from Drupal 7 to SugarCRM recently on one of our Drupal projects. This article gives an overview about how to create modules in SugarCRM and connect them to a Drupal site. Read on to know how to integrate SugarCRM with Drupal

Create modules in SugarCRM.

A sugar CRM module is used to hold data in sugar CRM. To create a module in sugar crm, go to sugar CRM's administration console and the module builder available in developer tools section. Select module builder to create a new module. First of all, create a package in order to create modules. Provide a name for the package and add a key. This key is used to refer the package. Once you have created the package, select a new module from the list of modules.

Here provide a module name, label, and select the type of the module. There are 6 different object types for a module. You can select an object type based on your module's purpose, i.e. if your module is meant to track user details, select object type people. Now, select the view field button, it will display all the fields available in that object type. We can either add new fields or edit the existing fields, as per our needs.

Editting layouts

After adding all the fields, set layout for the newly created modules. You can drag and drop the necessary fields to the panel in the order in which they are supposed to appear in the layouts. Also, remove the unwanted fields by dragging and dropping them in the trash on the left side of the edit layout screen.To add a new row, select and drag and drop the new row to the panel.

Setting relationship between modules

It is important to set relationship between modules, if we are handling multiple modules in a package. To set relationship between modules, select the 'view relationship' link, and click on 'add relationship' on the screen displayed. Select the type of the relationship. For example, if you want to set the relationship between a customer and an order, it is a 'one to many' relationship. Under the related module section, select the module name to which you want to relate and save.

Deploying a package

To put the package we created into effect, we have to deploy the package. This can be done by selecting deploy from the studio. If you have modified any of the modules after deployment, please do remember to redeploy the package.

To integrate sugarCRM REST api with drupal

Download and install sugarondrupal module from here.

Now, from admin/config/sugarondrupal/settings, set the sugar crm endpoint and select webservice protocol as REST and select json encoding. Check status report, to ensure the site can communicate with the sugar crm endpoint. If connection is established, you will get a report like this.

If you get status report as ok, then you are good to go. You can add custom code to push data from drupal to sugarCRM by making use of the functions provided by the module sugarondrupal. Please see this article(place the link to the other article here)for more information.