Netsuite-Salesforce Automation: Aggregate Opportunities into a CSV File

ArcESB seamlessly links your cloud-based CRM and ERP accounts together, making it easy to automate manual tasks, such as aggregating data from different accounts. The following sample project demonstrates how different connectors in ArcESB are used to automatically aggregate Salesforce and NetSuite data and store it as a CSV file. The sample connector configuration polls Salesforce and NetSuite for opportunities and aggregates them to a single CSV file.

Drop in the Sample Project

To get started with the sample, download and install ArcESB (free 30-day trial). Then, download the sample project and extract and copy the contents to the "data" folder in the installation location for ArcESB. For Windows installations, this is likely C:\Program Files\ArcESB. Please consult the documentation for the Java build of ArcESB for Linux/Unix/Mac installations.

Poll Salesforce for Opportunities

The Salesforce Connector pulls Salesforce entities into ArcESB.

Connect to Salesforce

Configure the username, password, and security token fields in the Salesforce Connector Settings tab.

Configure the Query

The Salesforce Connector is configured with a limited output template that queries the Salesforce Opportunity table. The application generates a single XML file for each opportunity processed.

To view the logic controlling the query, open the template file and click the edit button next to the Opportunity entry in the Output Templates table. Set the skipProcessedRows attribute to 'true' in order to prevent the application from pulling in data that has been previously retrieved.

Run the Query

Click the run symbol next to an individual template to run that specific query, or click the run symbol in the Output Templates window to run all of them in succession. The connector has already been configured to poll the Salesforce account on a scheduled interval. These settings can be found under the Automation Settings section.

Once the connector has retrieved the data and generated an XML file, the result is sent to the MAP_SF_to_Opp Connector.

Map the Salesforce Opportunities to a Generic Opportunity

The mapping connector MAP_SF_to_Opp is used to convert the XML file containing the Salesforce opportunity to a generic XML object representing any opportunity. This generic XML object can be sent to other ports for further processing.

Configure the Mapping

This mapping connector comes preconfigured, but you can configure the mapping on the Settings tab. Select source and destination files to define the available fields and use the interface to define the mappings. In this sample, use the following files:

Source
/data/Salesforce/Templates/Output/Opportunity.xml: the output template from the Opportunity table
Destination
/data/MAP_Opp_to_CSV/Samples/GenericOpportunity.xml: an included generic opportunity sample file

Translate Salesforce Opportunities to XML

Files placed in the Send folder for the MAP_SF_to_Opp Connector are automatically processed. You can also send files manually. On the Send tab, click More -> Upload. Click the Send button to process the file.

After converting the opportunity to a generic one, the file is automatically sent to the MAP_Opp_to_CSV Connector to await further processing.

Poll NetSuite for Opportunities

The NetSuite Connector pulls NetSuite opportunities into ArcESB.

Connect to NetSuite

Configure the username, password, and account ID fields in the NetSuite Connector Settings tab.

Configure the Query

The NetSuite Connector is configured with a limited output template that queries the NetSuite Opportunity table. The application generates a single XML file for each opportunity processed.

To view the logic controlling the query, open the template file. On the Settings tab, click the edit button next to the Opportunity entry in the Output Templates table. Set the skipProcessedRows attribute to 'true' in order to prevent the application from pulling in data that has been previously retrieved.

Run the Query

Click the run symbol next to an individual template to run that specific query, or click the run symbol in the Output Templates window to run all of them in succession. The connector has already been configured to poll the NetSuite account on a scheduled interval. These settings can be found under the Automation Settings section.

Once the connector has retrieved the data and generated an XML file, the result is sent to the MAP_NS_to_Opp Connector.

Map the NetSuite Opportunities to a Generic Opportunity

The mapping connector MAP_NS_to_Opp is used to convert the XML file containing the NetSuite opportunity to a generic XML object representing any opportunity.

Configure the Mapping

This mapping connector comes preconfigured; however, you can also configure the mapping any way you like. To configure the mapping, select source and destination files to define the available fields and use the interface to define the mappings. In this sample, use the following files:

Source
/data/NetSuite/Templates/Output/Opportunity.xml: the output template from the Opportunity table
Destination
/data/MAP_Opp_to_CSV/Samples/GenericOpportunity.xml: the included generic opportunity sample file

Translate NetSuite Opportunities to XML

Files placed in the Send folder for the NetSuite Connector are processed automatically. You can also send files manually. On the Send tab, click More -> Upload. Click the Send button to process the file.

After converting the opportunity to a generic one, the file is automatically sent to the MAP_Opp_to_CSV Connector to await further processing.

Aggregate the Opportunities to a CSV File

The mapping connector MAP_Opp_to_CSV is used to convert the XML files containing the Salesforce and NetSuite opportunities to a single CSV file (set the Batch Results advanced setting to 'true').

Configure the Mapping

This mapping connector comes preconfigured; however, you can also configure the mapping any way you like. To configure the mapping, select source and destination files to define the available fields and use the interface to define the mappings.

In this sample, use the following files:
Source
/data/MAP_Opp_to_CSV/Samples/GenericOpportunity.xml: the generic opportunity sample XML
Destination
/data/MAP_Opp_to_CSV/Samples/GenericOpportunity.csv: the generic opportunity sample CSV

Translate the Opportunities to CSV

Files placed in the Send folder for the MAP_Opp_to_CSV Connector are automatically processed. You can also send files manually. On the Send tab, click More -> Upload. Next, click the Send button to process the inbound opportunities and aggregate them to a single CSV file.

More Information & Next Steps

As you can see, ArcESB makes it possible to automate your cloud data accounts, easily aggregating similar entities from different sources. For more information on ArcESB, visit our home page. Download your free, 30-day trial and start controlling your business document exchange today!



Download & Install Sample

Already running ArcESB? This sample will setup ArcESB with the data and connector configurations referenced in this article: