ERP Integration

We would like to integrate suitecrm with our ERP, in the manner that for new erp customer to search suitecrm/accounts
for existing records by passing some parameters (tel, name etc).
We have already implemented a function with REST that returns the data, but we would prefer to call the specific module
and just open the browser with suitecrm and the corresponding info.
If this is possible, how we will pass the login data and the parameters ?

Here’s a page with some pretty cool code examples for logging into SugarCRM / SuiteCRM using the very simple REST interface…

http://webcache.googleusercontent.com/search?rls=en&q=cache:s9z2YADGnNMJ:http://www.ibm.com/developerworks/library/x-sugarcrmrest/%2Bsugarcrm+api+php+example&oe=UTF-8&hl=en&&ct=clnk

If you really want to simulate the current user logging into SuiteCRM, and immediately show to the user the web page for the Account, then you’ll have to actually create a login session by communicating with the SuiteCRM web application, build the URL string from the various required parameters necessary to view the Account page (the key part is the UUID of the Account record), and then launch the browser using that URL you built as the parameter.

Post back with your results !

More recent version of logging in, to retrieve session key, using REST 4.1 API (2014)
http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.5/02_Application_Framework/Web_Services/Examples/REST/PHP/Logging_In/

Thank you for your reply and your suggestions for coding.
He have already a REST code that returns upcoming activities, but we need an example for how we pass parameters for
searching accounts, i.e by phone, name etc
We are looking for it and if you have any example it will be welcome …

With the following code - after login and get the sessionid - you can query leads, accounts etc and returns the results in json format.

But, what we need, is to pass the parameters directly to suitecrm, open the corresponding module/page and show us the results.
In the other hand with the below code, if the result is uniqueue, we could have the url to open the module with the record info.
But, what if there are more than one records ? Ok, we can create a form/popup with the selections, but this is not practical for the user.
Any idea ?


$fields_array = array(‘first_name’,‘last_name’,‘phone_work’);

$parameters = array(

'session' => $session,                                
'module_name' => 'Leads',                            
'query' => " leads.last_name like '%Boris%' ",  
'order_by' => " leads.last_name ",                
'offset'  => 0,                                               
'select_fields' => $fields_array,                      
'link_name_to_fields_array' => array(array()),
'max_results' => 5,                                               
'deleted' => 'false',                                        

);

$json = json_encode($parameters);

$postArgs = array(
‘method’ => ‘get_entry_list’,
‘input_type’ => ‘JSON’,
‘response_type’ => ‘JSON’,
‘rest_data’ => $json,
);

curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);

$response = curl_exec($curl);

// Convert the result from JSON format to a PHP array

$result = json_decode($response);

print “
”;
print_r($result);
die;

This URL will return ALL records of ANY type that contain the search query string.


http://CRM/index.php?action=UnifiedSearch&module=Home&search_form=false&advanced=false&query_string=Sammy+Davis%2C+Jr.

If you want it to return only a list of Contacts then you could just do a similar URL to show the List View for Contacts filtered by your query string.

1 Like

I need to get Client Info and Product Info, pulled into the CRM from my ERP (used for sales and stock). Is it possible to hook them up vía webservice or some kind of module.

THANK YOU

I have the same exact question! HELP PLEASE!

Hello,

It is possible via REST API.
Here is some basic REST API Example. http://urdhva-tech.com/blogs/sugarcrm-rest-api-example