I have created a suitelet, but now i am running in...
# suitescript
c
I have created a suitelet, but now i am running into issues.. I really need a lot of data for this task, and a lot of iterations. Therefore i ran into script usage limitations... now im wondering what route i should go.. Would a map reduce script be suitable for a task with a lot of data and a lot of calculations/iterations, which has to be shown to the user in the end, on the custom page
w
The short answer is no. It sounds like your Suitelet is needing far too much data in the initial request. If it is just collecting a lost of conditional data into a custom report, then maybe the suiteanalytics workbook feature might be worth exploring. Alternatively, have a request trigger your map/reduce, save the result to a custom record then email the user with a link to the record when complete. If you are using this data to drive a user interface, then maybe try fetching data as required e.g. "user selects subsidiary" -> "do ajax call to load a list of locations in that subsidiary" -> "populate another field on the form with those locations".
c
The user is able to enter an Assebmly item, and then the script will search for its related records (work orders) and find the actual runrates of the specific item. After that it will search for similiar items that have been created, that uses the same material, same amount etc, and also load these runrates, and then calculate and average runrate etc, the plan is to add more features but yea, i just really need a lot of data and a lot of data handling within the script
w
Depending on how you want these material relationships to be structured, a workbook might do what you want in one-action, otherwise you may need to use multiple ajax calls to let the user “drill-down” to the data that they actually want
e
I'd call a restlet from the suitelet multiple times. Once you have your initial data, call the restlet using a Promise and return what you need when you need it
👍 1
r
Haven't seen your code, but sometimes it's possible to substitute searching for record loads or to consolidate searches by using iteratively generated criteria in a single search instead of performing many searches iteratively.
c
@ehcanadian would i be able to pass data from the suitelet to the restlet? and then of course return the results from the restlet to the suitelet