Artisan IMG > Salesforce (salesforce)
Artisan IMG > NetSuite SOAP (netsuite)

Create Netsuite Sales Order when Salesforce opp is "Closed Won"

Workflow
Sales
Intermediate

This is a 'Workflow' template which means that it is a single standalone workflow.

Some workflow templates can be modified to work with other workflow templates - e.g. to convert a data sync between two services from uni-directional to bi-directional

Overview
Copy

This workflow creates a Sales order in Netsuite for an Opportunity that is complete in Salesforce.

It is triggered by a Closed Won action in Salesforce. It then checks if the counterparty has an existing Netsuite Customer record. If not, then a new one is created. Later, using the Netsuite ID, a Sales Order is generated to represent the Contract deal being closed.

The entire process typically requires a higher degree of customization than usual. A typical use case for this template could be where finance teams have required fields and usually have to represent multiple products on each Sales Order. You can customize this template to handle any situation based on your team's requirements.

Connectors Used
Copy

The following connectors are used in this template. This is provided for reference only - there is no need to read through the linked connector pages, as all you need to know for this template is explained here:

End Result
Copy

The image below shows a Salesorder in Netsuite created for a completed Opportunity in Salesforce:

Prerequisites
Copy

This workflow assumes the following:

  • You have API Access to SFDC and Netsuite.

  • You can create custom fields in SFDC and Netsuite to link Accounts and Customers (recommended)

Getting Live
Copy

Workflow Logic
Copy

Implementation notes
Copy

Create a List of items to map into Create NS Sales Order step
Copy

In order to create a list of items in the following format, first you need to identify the source from which you may pull the data.

1
{
2
"key": "item",
3
"value": {
4
"items": [
5
{
6
"amount": 15000,
7
"item": {
8
"id": "10"
9
},
10
"billingschedule": {
11
"id": "1"
12
}
13
},
14
{
15
"amount": 0,
16
"item": {
17
"id": "13"
18
},
19
"billingschedule": {
20
"id": "1"
21
}
22
}
23
]
24
}
25
}

In this example, we have used Loop connector as a generic placeholder to fetch the item data for any service or database you may wish to use.

Exactly how this is done will depend on the service you are pulling data from.

The key thing here is that the data being sent to Netsuite must be in the exact format as shown, regardless of where it has come from.

To learn in detail about each step, refer to the Step-by-step Explanation section.

Step-by-step Explanation
Copy

SFDC Opportunity Stage Change
Copy

The trigger listens for a change in the value of the 'StageName' field of an opportunity in Salesforce.

It notifies the workflow when this occurs.

Loop Opportunities
Copy

The main loop to get the opportunity details received through the trigger.