Typically, in a scenario like this, I don't even u...
# suitescript
s
Typically, in a scenario like this, I don't even use CSV import, I would just use the CSV file as input to a Map/Reduce script, having the Map phase create/update a record from each line of the CSV file, and then perform the additional work in the Reduce phase.
c
Do we need to create a suitelet with file name option to achieve this? Please suggest.
s
That is one way to do it. A suitelet where you can choose a file, and a button to submit the Map/Reduce task. You'll want a script parameter on the M/R script so that you can pass the file name or id as a parameter to the M/R script deployment
c
Ok thank you Scott.
s
Alternatively, to make use of standard CSV import functionality and avoid having a custom suitelet, you can use a staging table where the CSV import just inserts data into the staging table, then a Map/Reduce script processes those temporary records, creating the actual record, performing any post-processing steps, then deleting the temporary record.
c
Can you please elaborate above, I didn't get what is staging table , and how can we trigger M/R script with standard CSV import functionality ( some where it has to start M/R task right, where would be that entry point).
s
Okay, it was just an alternative way of achieving the same results, so if it doesn't make sense, then feel free to ignore it.
c
Sorry i didn't mean it, just trying to understand how to achieve alternatively.
s
True, but you only really need one working way to do it, so no worries. However the concept of "Staging" data is a broad term that essentially refers to an intermediate data storage, between the input data and the final destination. So, instead of going straight from CSV file to the final record, you'd have an intermediate staging record. By breaking the import into two steps, it gives you an easy way to process just the newly imported data. https://en.wikipedia.org/wiki/Staging_(data)
But, it's just one way to achieve that, and not the only one. You original idea of a Suitelet would work fine as well. Whatever is most familiar to you is probably the best approach.
c
Ok Scott, thanks a lot once again for providing all details.