Salesforce.com EDI Integration

Electronic Data Interchange (commonly known as EDI) is essentially the standard method when it comes to exchanging files in modern industry. Since its inception in the 1980s, EDI can be found in industries ranging from manufacturing to health care. Through EDI, businesses have a process for exchanging their business documents with their trading partners.

EDI requires processing and storing the data contained in EDI documents. Arc handles this, providing EDI mapping, messaging and translation. It's built to make it easy to translate and map EDI standard documents to and from Salesforce with seamless Salesforce EDI integration.

This article will provide a walk-through for configuring Arc to receive a purchase order and inject it into Salesforce.com as an Order.

Setting up the Salesforce EDI Integration Sample

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

Next, modify the X12 document in the sample to refer to existing an existing Account and existing Products in your Salesforce.com company. Using a text editor to open the 850.x12 file located in the Send subfolder of the X12_Wayne_Tech_IN folder, find the placeholder values FILLER_ACCOUNT_ID, FILLER_PRICEBOOKENTRY_ID1, and FILLER_PRICEBOOKENTRY_ID2 and replace them with an actual Account Id and Pricebook Entry Ids from Salesforce.com. These values can be found in the Account and PricebookEntry tables exposed by the CData ODBC Driver for Salesforce.com.

The last step for setting up the sample is editing the Order template for the MAP_850_IN Connector (located in the MAP_850_IN subfolder of the data folder). Open the file in a text editor and replace the text FILLER_PRICEBOOK_ID with an existing Pricebook Id from your Salesforce.com company. You can find this value in the Pricebook2 table exposed by the ODBC Driver. This edit will ensure that the Order uses the appropriate Pricebook to price the items. If you wished, you could add some logic to the MAP Connector to determine the Pricebook Id based on the incoming account or vendor. If you have questions about this process, please reach out to our Support Team.

Once you have filled in the X12 document with actual values from your Salesforce.com company and edited the Order template, you need to ensure that you have configured your connection to Salesforce.com properly.

Connecting to Salesforce.com

If you have not already, you will need to install the CData ODBC Driver for Salesforce (you can download a free, 30-day trial). If you only now downloaded and installed the driver, please restart Arc before proceeding.

With the ODBC Driver installed, the next step is to configure your connection to Salesforce.com as an ODBC data source. You can create one from the ODBC administration tool for your operating system. For information on configuring the connection to Salesforce.com, refer to the online Help documentation for the ODBC driver.

Lastly, click the Ports tab and select the Salesforce Database Connector from the connector drop-down menu. On the Settings tab, you can configure your connection to your Salesforce.com account. Click the ODBC radio button for the Connection Type and select the DSN you just configured from the drop-down menu for the Data Source Name (DSN). To confirm your connection, you can click the Test Connection button.

Document Translation / Data Integration Walk-Through

With the inbound X12 document, Order template, and connection to Salesforce.com properly configured, you are now ready to begin the walk-through.

Translate an X12 Document to XML

As we work through the sample, we start with the assumption that your trading partner has just sent you an 850 document (purchase order) in X12 format. This document is sitting in the Send folder of the X12_WayneTech_IN Connector, ready to be processed. When you select the document and click the Send button on the Send tab of the X12_WayneTech_IN Connector, Arc will translate the standard X12 format into an XML format and place it in the Send folder for the MAP_850_IN Connector.

Translate an XML Purchase Order to an XML Order

The MAP_850_IN Connector is a scripting connector designed to translate the 850 document (in XML) from the X12_IN Connector into an Order (in XML) that can be processed by the Salesforce Database Connector.

Now that you have the XML file for the 850 document (a purchase order), you can use the script and template included in the sample to translate the document into an Order formatted for use by the Salesforce Database Connector. The XML elements used in the mapping template are derived directly from the column listing for the Order table in Salesforce.com.

How the Translation Works

The TranslationScript.rsb file maps the values at specific XPaths in the XML document to new fields, which will be used to create a new document based on the ORDER.template file.

Performing the Translation

To translate the XML 850 document, simply select the 850.xml document on the Send tab of the MAP_850_IN Connector and click Send. This will create a new document, ORDER_TIMESTAMP.xml, and place it in the Send folder of the Salesforce Connector.

Push an Order to Salesforce.com

Now that you have an Order in the Send folder for your Salesforce Connector, you can inject the Order into Salesforce.com. This connector uses the CData ODBC Driver to add the Order, ready for processing, to the Salesforce.com account.

Push the Order to Salesforce.com

To insert the Order into Salesforce.com, select the ORDER_TIMESTAMP item in the Send folder and click Send.

At this point, we have a newly inserted Order in our Salesforce.com account, with the Order Items and prices referenced in the original 850 document. With this Order in place, we are now ready to work with it like any other Order in Salesforce.com.

More Information & Next Steps

As you can see, Arc and CData Software make Salesforce EDI integration fast, simple and as easy as possible. Try Arc today to seamlessly automate your business document exchanges with your partners. For more information on Arc, visit our home page and for more information on the Salesforce ODBC Driver available from CData Software, visit the CData Software website. You can also see a full list of the data sources CData Software connects to with ODBC Drivers. Download your free, 30-day trials and start controlling your business document exchange today!



Download & Install Sample

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