CSV Requisition Import
As of January 2018, one of my clients had a requirement to mass import requisition records via a CSV file. Unfortunately, native NetSuite functionality could not accommodate this and thus, a scripted solution was needed to parse through each column/row in the CSV file to automatically import each record. For this solution, I decided to future proof the concept so users can mass import requisition records themselves rather than building a script for a one-off task.
Solution:
Build a number of Suitelets which would accommodate a step by step process, which allows the business user to:
- Upload their CSV file
- Validate the headers of that file and the file type
- Validate the format of the data within the file
- Show a summary of the data that will be imported
- Schedule the import
- Send email notification of records created or errors thrown
Reflection
I first became aware of this requirement when I navigated to SETUP > IMPORT/EXPORT on NetSuite and found that "Requisition" record type was not an available option for CSV import. This was in early 2018, and was rather surprised by this; especially as both purchase and sales orders are import-possible. During implementation, it was a challenge mapping the data to the fields because of the different data types involved (e.g. ensuring date columns are formatted correctly). To increase the chances of a successful import, I prompted to using INTERNAL IDs as the method for populating the file. This way, no errors would be thrown searching for the exact same value on NetSuite. However, this solution does come with its disadvantages. One of which is the maintenance required to update the master Excel file which performs the VLOOKUPS and provides the internal IDs.