I have a custom suitelet screen which displays the...
# suitescript
c
I have a custom suitelet screen which displays the list of Invoices in a sublist where user can select multiple Invoices for approval. The problem is when the submission happens, I'm passing list of Invoices to the another suitelet from the client script for processing. I'm seeing request time out error in the suitelet and the response is not returning back to the client script but In the background all the Invoices are processing correctly. Is there any way that I can fix this Issue? Thanks in advance!
e
So, it’s taking too long to approve all of the invoices and it’s timing out?
I have a similar Suitelet for expense approvals. Users were complaining about how long it took to approve a large number of expenses. What I did was have the Client Script fire off a Map/Reduce script that handles all of the approvals. In order to make it a fast user experience, I add the transaction numbers to a cache before I fire off the Map/Reduce job. Then, I fire the job and redirect the user back to Suitelet. The Suitelet then excludes any transaction numbers in the cache. The cache expires after 15 mins or so, so if for some reason some of the transactions didn’t succeed approving, they would then show back up on the Suitelet.
1
c
Yes that's correct. Actually, I'm displaying the loading icon in the screen until the backend suitelet process ends. Due to this suitelet timeout error, I'm not getting the response back to the client script so the loading icon is not stopping.
Got It. Thanks @eblackey. I have a question, If I Invoke map reduce script from client, does It trigger instantly? There might be a case where other map/reduce is running in the queue that prevents to run the Map reduce script which is Invoked from the client. Any thoughts?
e
I think I have the Client Script call a Restlet. The restlet does the job of adding items to cache and then calling the Map/Reduce job. It is possible the Job won’t be run right away if processors are being used up.
But, again that’s why I’m using the cache. In my case, the user doesn’t really care if it takes 5-10 mins for expenses to actually approve in the background. They just want to know they did their part of approving them, so I want that to happen quickly for them. Your use-case might be different. If the user needs to know when the invoices are approved, it might not work.
c
Got It. I agree with your point. Thanks @eblackey