Netsuite Csv Import Using Suitescript 2.0


 


As a Netsuite developer we often come across importing few record types that are not supported by suitescript to manage the CRUD operations.

This is where we can take advantage of the native CSV import function in netsuite through Suitescript.

Here is the step by step approach for the process.

Step 1) Create a saved csv import for the record type that you wish to automate using suitescript and add the necessary mappings. You can find how to create a csv import in a separate blog with I am about to publish.

Step 2)In the Suitescript 2.0 code add a logic to submit the task of type csv import where you provide the ID of the saved csv import along with the file.


Step 3)Once the task is submitted you can check the task status using the task ID.

Step 4)Run a loop till the task the gets completed.

Scenario : We are in the process of creating matrix items in Netsuite, where we encountered a challenge where in the attributes of the matrix items (Colors, Sizes) may or may not be available in Netsuite.There is no way we can create a custom lists in Netsuite using Suitescript. This is where we employed the task of invoking a saved csv import using the file that is generated in the script itself with the missing color and sizes in Netsuite.

Once, the custom lists are updated we proceed to the logic of creating matrix items.


SAMPLE CODE :

Generate the file to be used for csv import.



Automating Csv import.












Comments

Popular posts from this blog

Enhancing Advanced PDF Templates with Suitelet Scripts in NetSuite

Advantages of Using Celigo CloudExtend Excel for Netsuite as compare to Netsuite Csv Imports