Salesforce to NetSuite OpenAir Integration

NetSuite OpenAir is the world's No. 1 Professional Services Automation (PSA) solution. From resource management and project management to time and expense tracking, project accounting, advanced billing and invoicing, the NetSuite OpenAir supports the entire professional services delivery lifecycle with a powerful Software-as-a-Services (SaaS) suite

What is NetSuite OpenAir?

NetSuite OpenAir is the world’s No. 1 Professional Services Automation (PSA) solution. From resource management and project management to time and expense tracking, project accounting, advanced billing and invoicing, the NetSuite OpenAir supports the entire professional services delivery lifecycle with a powerful Software-as-a-Services (SaaS) suite.

How does the NetSuite OpenAir XML work?

  1. NetSuite OpenAir provides OpenAir XML API as a layer for exchanging the NetSuite OpenAir data between the main site and peripheral programs.
  2. OpenAir XML API is based on industry standard components: HTTPS (Secure Hypertext  Transfer Protocol) and XML (Extensible Markup Language).

How to authenticate NetSuite Credential via Postman Extension using Google Chrome?

  1. Enter the Request URL.

For NetSuite Sandbox: https://sandbox.openair.com/api.pl

For NetSuite Production: https://www.openair.com/api.pl

  1. Add the XML Payload to Authenticate.
  2. Set the request method as “POST” and Send the Request.

Request payload:

The below XML Payload are used to authenticate with NetSuite Open Air. The following attributes values are mandatory for authentication:

1. Namespace

2. Key

3. Company

4. User

5. Password

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<request API_ver="1.0" client="test app" client_ver="1.1" namespace="Namespace" key="API Key">

<Auth>

<Login>

<company>Company Name</company>

<user>User Name</user>

<password>Password</password>

</Login>

</Auth>

</request>

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<response>

   <Auth status = "0"></Auth >

</response>

Note: <Auth status = “0”/> indicates the authentication is successful. In case of authentication failure, you will see an error code such as 401, 505, and etc.

How to read data from NetSuite?

    The below example shows how to retrieve the “Project” object record from NetSuite. The basic syntax to read the data as follows:

<Read type="Project" method="all" limit="1"/>

Type – It denotes the NetSuite object/table Name.

Method – It denotes the search option. You can also read records based on filter/criteria, such as equal to, not equal to, and etc in the place of method attribute.

Limit – Number of records to Return.

Request payload:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<request API_ver="1.0" client="test app" client_ver="1.1" namespace="Namespace" key="API Key">

      <Auth>

   <Login>

       <company>Company Name</company>

       <user>User Name</user>

       <password>Password</password>

   </Login>

     </Auth>

<Read type="Project" method="all" limit="1"/>

</request>

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<response>

<Auth status = "0"></Auth >

<Read status = "0">

     <Project>

    <name>Standard Activities</name>

    <only_owner_can_edit>1</only_owner_can_edit>

    <id>4</id>

    <customer_name>Test Company</customer_name>

    </Project>

</Read>

</response>

How to write data to NetSuite?

The below example shows how to add/create “Project” object record to NetSuite. The basic syntax to create a record as follows:

<Add type="Project" enable_custom="1">

<Project>

  <name>Test Project</name>

  <customer_name>Demo Account</customer_name>

</Project>

</Add>

Add the above payload after the end of </Auth> tag. It is similar to the read request example.

Type – It denotes the NetSuite object/table Name.

enable_custom – It denotes the custom field to be included while creating record. Custom fields will be in the the form of <my_custom_field__c> </my_custom_field__c>. Similar to Salesforce custom field naming convention with “__c”.

How to modify/update data to NetSuite?

The below example shows how to modify/update the “Project” object record to NetSuite. The basic syntax to modify a record as follows:

<Modify type="Project" enable_custom="1">

<Project>

   <id>192</id>

   <name>Test Project Updated</name>

</Project>

</Modify>

ID field is required in order to update the record.

How to delete data from NetSuite?

The below example shows how to delete the “Project” object record to NetSuite. The basic syntax to delete a record as follows:

<Delete type="Project" enable_custom="1">

<Project>

    <id>192</id>

</Project>

</Delete>

Id field is required in order to delete the record.

NetSuite Project View:

Here is the “Project” view of the NetSuite Open Air.

Integrating NetSuite with Salesforce:

Step 1: Create a HttpRequest class.

Step 2: Ensure the request method is set as POST.

Step 3: Build the above example payload structure, by using standard Reading and Writing XML Using the DOM method. Set the payload in the Place of setBody method of HttpRequest.

Step 4: Make a callout from where you need, such as in Visualforce page, Batch class, Button, and etc.

Step 5: Response will be in the form of XML. So, get the response of HttpRequest and process it according to your requirements.

Summary:

The NetSuite Open Air’s Professional Service Automation tool helps improve and optimize service organizations and also provides more visibility and control for project-based businesses.

References:

  1. NetSuite Open Air Guide.
  2. Reading and Writing XML Using the DOM.

About MST

At MST Solutions our cornerstone is to adapt, engage and create solutions which guarantee the success of our clients. The talent of our team and experiences in varied business verticals gives us an advantage over other competitors.

Recent Articles

Work with us.

Our people aren’t just employees, they are key to the success of our business. We recognize the strengths of each individual and allow them time and resources to further develop those skills, crafting a culture of leaders who are passionate about where they are going within our organization.