would it be possible for me to call a map reduce s...
# suitescript
c
would it be possible for me to call a map reduce script from my suitelet? So that i can get all the data with the map/reduce, and maybe handle some of it with some sorting and such, and then return it to my suitelet to show the final result to the user?
d
you can schedule a map/reduce script with the N/task module. But you wont be able to have the map reduce script return that data. What I would suggest is having the suitelet create a custom record and then schedule the map/reduce script to fill that record with the data (either visible in fields or in JSON hidden from the user). Then redirect the user to that record. You could have the map/reduce script update the record with a status field when its done so the user can refresh that custom record and see if its done. If you decide to store the data in JSON you could also have another button on your custom record that points to a suitelet that uses that JSON to display a nice webpage. This is just a rough sketch of how it could work, and how I would implement something like this. This also has the side benefit of users being able to share the link to the record so others can see the results without having to run the map/reduce again