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

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

Overview

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

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

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

end-results

Prerequisites

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

Workflow Logic

complete-wf

Implementation notes

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

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.

{
"key": "item",
"value": {
"items": [
{
"amount": 15000,
"item": {
"id": "10"
},
"billingschedule": {
"id": "1"
}
},
{
"amount": 0,
"item": {
"id": "13"
},
"billingschedule": {
"id": "1"
}
}
]
}
}

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.

implementation-notes

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

Step-by-step Explanation

SFDC Opportunity Stage Change

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.

SFDC Opportunity Stage Change

Loop Opportunities

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

Loop Opportunities