NetSuite and Salesforce Integration using Restlet
Salesforce and NetSuite are both very popular Customer Relationship Management solutions. Even though both can be labeled two kinds of ‘CRM’ they are very different in their features and use. Salesforce is impressive for all tasks related to lead generation and tracking, whereas NetSuite is great in handling finance. This is the reason why we see a lot of enterprises using both of these tools at the same time. We have seen lots of use cases where a company uses NetSuite for resource planning and Salesforce for analysis, or using Salesforce of lead closing, and NetSuite for pricing and order control.
One thing you would notice is that in the end both these solutions are inter-related. Some operations are performed at one pit-stop and others are catered to at the next pit-stop! Now these pit-stops are actually tools. This created obvious problems related to data entry and data transfer from one tool to another. For example, companies will have to transfer all lead details, including quoted prices and account information, from Salesforce to NetSuite every time they close a case.
So how to solve this problem? Simply integrate Salesforce and NetSuite.
Ways to integrate Salesforce and NetSuite
First of all it is important to understand better what the term ‘integration’ implies here. By integration we mean that data from Salesforce is transferred to NetSuite and vice versa in an automated way. It doesn’t matter whether every Salesforce and NetSuite object gets synced here or just one. The main objective is that data transfer happens automatically, or by a button, without someone manually downloading or uploading data.
Keeping these requirements in mind, there are a number of ways by which you can integrate the two systems, however these three ways are the most prominent ones by which we can integrate Salesforce and NetSuite.
- Use a custom integration adapter- as a custom middleware based integration
- Use a third party integration service like Boomi AtomSphere, Actian, or Informatica Cloud
- Create Restlet web service based integration using NetSuite and Salesforce API
Developing an adapter requires a lot of coding, is time consuming, and gives a performance that is not as comparable to the other two because of untested and (many times) unforeseen processes.
Using a third party service is of course the most convenient but it is also pricier and does not have the flexibility one may receive in custom integration approaches.
Custom Restlet based integration on the other hand is faster to develop, better in performance, and somewhat less pricey in a long term setting than an integration service.
Restlet Based integration between Salesforce and NetSuite
The integration between Salesforce and NetSuite via Restlet API is a four step process
- Creating and adding restlet scripts on NetSuite
- Authentication requests in Salesforce and NetSuite
- Data Transfer in Salesforce and NetSuite
- Running batch classes in salesforce for automated integration.
As we said that for integration we will have to create separate JS files for each object, so for this example we are going to automate the integration of contact and event fields of Salesforce and NetSuite.
Step 1: Creating and adding restlet scripts on NetSuite
The process starts with adding a JS script file in NetSuite to create new fields. In this example we are going to create a new contact. You need to add new script file for every new object that you want to sync.
Step 2: Authentication requests in Salesforce and NetSuite
No data transfer can take place without authentication. This is an example code to authenticate NetSuite credentials in Salesforce. In most cases we run authentication callouts for NetSuite credentials, and using Salesforce fetch data from NetSuite or Push data to NetSuite. (But you can do the other way around as well )
Step 3: Data Transfer in Salesforce and NetSuite
For data transfer from Salesforce to NetSuite, you will have to create separate web services in Salesforce. This example is about syncing Salesforce opportunities.
Similarly for fetching data from NetSuite, you need to create data fetching Batch helper in Salesforce and create callouts for fetching JSON data from NetSuite database. In this example we are fetching event data from NetSuite and storing it in Salesforce Object.
Notice the “endPoint” code in the beginning of code. It leverages the NetSuite URL slug that would correspond to the particular object we would be fetching. So yes, for different objects this code will be different.
Step 4: Running batch classes in Salesforce for automated integration
The overall process of syncing can be made real time but the best option is to run it in batches. Or you can always associate a button to call the classes at any point of time.
And that’s it, you are done!
NetSuite Cloud Connect
Looking at the demand of Salesforce and NetSuite integration, NetSuite has come up with NetSuite Cloud Connect. It allows you to sync Salesforce.com and NetSuite Financials. Through this you can easily sync quotes or sales orders of Salesforce and NetSuite in real time. It is not very flexible right now but we predict that it will evolve fast into the best integration option in the future.