Synchronize Opportunities in Oracle CX Sales and B2B Service with Oracle NetSuite Orders

Use this recipe to create a new sales order in Oracle NetSuite when an opportunity is won in Oracle CX Sales and B2B Service.

Note:

This recipe is available as Oracle CX Sales and B2B Service — Oracle NetSuite | Synchronize Opportunities and Orders in the Integration Store. Oracle provides this recipe as a sample only. The recipe is meant only for guidance, and is not warranted to be error-free. No support is provided for this recipe.

Overview

This recipe synchronizes opportunities in Oracle CX Sales and B2B Service with NetSuite sales orders in real time. It uses the standard Oracle CX Sales and B2B Service Adapter and the Oracle NetSuite Adapter. To use the recipe, you must install the recipe package and configure the connections and other resources within the package.

When an opportunity closes with the status Won in Oracle CX Sales and B2B Service, the main integration flow of the recipe is triggered. From Oracle CX Sales and B2B Service, this integration flow receives the customer and inventory item details associated with the opportunity won. Subsequently, the main flow calls two subsidiary integration flows to fetch the corresponding customer and inventory item details from NetSuite. The subsidiary flows check if the particular customer and inventory item records exist in NetSuite. If the records exist, the subsidiary flows return the internal IDs of the records to the main flow. If records don't exist (that is, if it's a new customer or a new inventory item), the subsidiary flows create a new customer record and/or a new inventory item record in NetSuite and return the internal IDs of these records to the main flow. After it receives the necessary details, the main flow creates a new sales order in NetSuite, thereby synchronizing the data between Oracle CX Sales and B2B Service and Oracle NetSuite.

Note:

  • You can run this recipe for one Oracle CX Sales and B2B Service product group at a time.
  • For successful execution of the recipe, you must add only one product group to the opportunity in Oracle CX Sales and B2B Service, and you must not add a product item to the opportunity.

System and Access Requirements

  • Oracle Integration, Version 21.1.2.0.0 (210129.2200.39447) or higher
  • Oracle NetSuite, Version 2018.1.0
  • Oracle CX Sales and B2B Service
  • An account on Oracle NetSuite with the Administrator role
  • Accounts on Oracle CX Sales and B2B Service with the Administrator role and the Sales User role (in order to create and close opportunities)

Integration Schemas

This section describes the integration flows present in the recipe package.

Main Integration Flow - Create Sales Order in NetSuite

This integration flow is triggered when an opportunity is closed with the status Won in Oracle CX Sales and B2B Service. It receives the customer and inventory item details associated with the opportunity won, and it calls the subsidiary integration flows to fetch the corresponding customer and inventory item details from NetSuite. After it receives the details, the main flow creates a new sales order in NetSuite.

Description of oec-ns-main-integration.png follows
Description of the illustration oec-ns-main-integration.png

Subsidiary Integration Flow - Fetch Customer Record from NetSuite

This integration flow is triggered by a REST service from the main integration flow. As a parameter, it receives the PartyId (AccountId) of the customer record associated with the opportunity won in Oracle CX Sales and B2B Service. Using this parameter, the flow checks if the corresponding customer record exists in NetSuite. If the record exists, it returns the internal ID of the record to the main flow. If the record doesn't exist (that is, if it's a new customer), the flow fetches the account details of the customer record from Oracle CX Sales and B2B Service and creates a new customer record in NetSuite. Finally, it returns the internal ID of this record to the main flow.

Description of oec-ns-subsidiary-integration1.png follows
Description of the illustration oec-ns-subsidiary-integration1.png

Subsidiary Integration Flow - Fetch Inventory Item Record from NetSuite

This integration flow is triggered by a REST service from the main integration flow. As parameters, it receives prodgroupid and prodgroupname of the inventory item associated with the opportunity won in Oracle CX Sales and B2B Service. Using these parameters, the flow checks if the corresponding inventory item record exists in NetSuite. If the record exists, it returns the internal ID of the record to the main flow. If the record doesn't exist (that is, if it's a new inventory item), the flow creates a new inventory item record in NetSuite and returns the internal ID of this record to the main flow.

Description of oec-ns-subsidiary-integration2.png follows
Description of the illustration oec-ns-subsidiary-integration2.png