NetSuite Add Operation through MuleSoft — Part 2

Muneeb Shaik
3 min readMay 31, 2023

--

In our last blog we have seen how to perform Get Operation using NetSuite Connector in MuleSoft by fetching Customer record details as an example. In this blog we will see how to perform Insert Operation using NetSuite Connector in MuleSoft by inserting a Customer record as an example.

Business Use-Case:

Let’s assume that there is a record created of the same or different record type such as Customer, Item, Order etc., at the source system (It can be a Database, Salesforce etc.,) which needs to be synchronized at NetSuite. MuleSoft’s NetSuite Add connector provides the facility to process the record and the same record will be created in NetSuite.

Insert Operation:

The add operation is used to add a new instance of a record in NetSuite. It is similar to the addList operation except that it allows only one record to be added at a time.

In the post-customer-flow as shown in the screenshot, NetSuite Add Connector inserts a customer record into the NetSuite system.

First, set up a HTTP Listener with a path and configure connection. and then add a NetSuite Add connector into the flow. In the Add connector, select Type of the record as Customer and provide payload in the Message.

Then add a Transform message before the Add operation and metadata will be generated automatically as shown in the below screenshot.

Select the required fields from the metadata and fill in the values that need to be added, now xsi schema needs to be defined in the code to make the operation work. Here is the example mapping with sample values for Customer record as shown in the below screenshot

And at the end of the flow add a Transform message and convert the output to JSON. Once the flow is triggered, NetSuite Add Connector will insert the Customer record and provide the NetSuite internal Id of the corresponding record in the response.

Conclusion

In this blog, we have seen how to perform Insert Operation using NetSuite connector in MuleSoft.

--

--