NetSuite Update List Operation through MuleSoft — Part 8
In our last blog we have seen how to perform Get List Operation using NetSuite Connector in MuleSoft by retrieving a list of one or more records by providing the internal ids that identify those records. In this blog we will see how to perform Update List Operation using the NetSuite Updatelist Connector in MuleSoft.
Business Use-Case:
Let’s assume that there are ’n’ number of records of the same or different record types such as Customer, Item etc., that were updated at the source system (It can be a Database, Salesforce etc.,) which needs to be synchronized at NetSuite. Instead of processing record by record using NetSuite Update connector in For-each loop, Mulesoft’s NetSuite UpdateList connector provides the facility to process all ’n’ number of records within a single request and the same records will be updated in NetSuite.
Update List Operation:
The updateList operation is used to update one or more instances of a record type in NetSuite. If there are multiple records, they can either be of the same record type or different record types. For example, it’s possible to update a customer and an item within a single request using this operation. Only the fields that have been populated in each submitted record are updated in the system. If a field has not been populated, it is not updated in the system and it retains its previous value. If a field is set to an empty string, the previous value of the field is replaced with an empty string.
POC:
In the updatelist-customer-flow as shown in the screenshot, NetSuite Update list Connector updates one or multiple records based on the NetSuite internalId provided for the corresponding record type.
First, set up a HTTP Listener with a path and configure connection. and then add a transform message which will have the input payload. Sample input payload can be seen in the below screenshot where two different customer records along with the updated fields are defined with the internal id of the record
Then add a NetSuite Update list connector into the flow. In the Update list connector, set payload in the Message section as shown in the below screenshot
Then add a Transform message before the Update list connector and metadata will be generated automatically.
Transform the input payload to the desired XML which will be passed as input to fetch records from NetSuite, xsi schema needs to be defined in the code to make the operation work. Mapping based on the input payload can be seen 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 Update list Connector will update the details for the given internal Ids.
Sample Response:
Conclusion
In this blog, we have seen how to perform Update List Operation using the NetSuite connector in MuleSoft.