Hi all, I am submitting a CSV import via an sched...
# suitescript
r
Hi all, I am submitting a CSV import via an scheduled script. Unfortunately, the CSV notification email is not being sent. I have checked the box Setup > Company > Email Preferences > General > Enable Email Alerts for WS and CSV Imports. The rest is working as expected, CSV import is going through successfully, etc. According to the explanation by the Oracle rep here (Why CSV Import Task submitted through Scheduled Script is not sending Status Notification Email? — NetSuite Community https://community.oracle.com/netsuite/english/discussion/4482309/why-csv-import-task-submitted-through-scheduled-script-is-not-sending-status-notification-email), it is due to: “Normally, CSV Import Status emails are sent to the user who initiated/submitted the import task. Since Scheduled Scripts run under the -System- user which is a virtual user assigned for processes that run by NetSuite Scheduler in the background, and no email is associated with that user, status emails are suppressed.” In the Job Status page, you can see the job name includes unknown-email@.account,,, A related enhancement mentioned in that link is this one - 490521 - SuiteScript 2.0 > N/task Module > CsvImportTask.submit() > ability to result Job ID in order to be able to download the CSV response file that contains the errors I did not recall this behaviour before, but certainly it is happening to me now. (here it seems somebody went through the same, not having this behaviour before and now having it - No longer receiving CSV Import Notification emails for certain CSV imports : Netsuite _https://www.reddit.com/r/Netsuite/comments/y7vzn7/no_longer_receiving_csv_import_notification/_) I have been trying to find a solution to send some sort of notification where we could list how did the CSV import went - so the number of records imported, errors, etc. I cannot find the email in the sent list, otherwise I would try to explore some options around that. Any ideas on how to tackle this to notify some users what was the status of the CSV import without having to manually go to
View CSV Import Status
page?
a
The only way around this that I can think of from the top of my head is to store the tasks IDs into custom records when you queue your CSV Imports, then a second scheduled script check those custom records and use the CSV Import Task Status and notifies the user via email if the tasks were successful or not.
r
You could also not use the built in CSV import task. Process the CSV in your script, update records, and then send the email. Depending on your requirements that might work.
r
@alien4u thanks for the suggestion, but I think in that case we would only get whether it was completed or not the CSV, but you would not get specifically the same information that is in the email, such as number of records imported successfully, etc - as explained here: Tip – 45: Pros & Cons of CSV Import through SuiteScript different versions in NetSuite – Netsuite Voyage https://ashabarijena.wordpress.com/2023/07/12/tip-45-pros-cons-of-csv-import-through-suitescript-differnt-versions-in-netsuite/ @reptar that would indeed be an alternative, thanks for the idea. Although not sure if it will make sense the effort in this specific case Thank you both!