If I am allowing a user to create many many record...
# suitescript
a
If I am allowing a user to create many many records with a csv upload, is it a very bad idea to have a User Event run on each of those creations? Am I much better off running a map reduce after all are created to do what I need it to do (set a certain field based on another field) for each record?
m
I don't know about much better off. Wouldn't the map/reduce have to reload the records in order to set the values? Curious to hear the perspectives of others but I'd think that could be a factor
b
if you care about how long it takes for the csv to finish, do the map reduce
the user event script will increase the time it takes for the csv import to complete
the map reduce will not
the map reduce will use time in the script processors, which may or may not be valuable depending on the account and how effectively the scripts are prioritized
a
yeah it really depends on your needs - if this is a one-time upload, i'd just let the script run on CSV knowing it'll take longer, rather than writing an entirely new script just for this instance. but if it's an upload they do regularly and it's also time sensitive/they have tons and tons of records where the script added time would be really noticable, maybe the M/R is worth it. or if you have multiple other UE scripts or other actions in that script that you don't want to execute in CSV, you woudln't want to check that checkbox since it enables all scripts/workflows, so you'd need to do the M/R in that case. or like battk said, if you have different limits on script processors vs CSV queue, that may affect your decision as well.