How can I reproduce NetSuite’s native progress tra...
# suitescript
m
How can I reproduce NetSuite’s native progress tracking (percentage) for a Map/Reduce script? In the standard NetSuite UI (e.g., when creating transactions in batch), the progress of background tasks is shown as a percentage that updates in real-time. I’d like to replicate this behavior for a custom Map/Reduce process — ideally showing the live progress percentage in a Suitelet. So far, I’ve tried using getPercentageComplete() in the Map/Reduce, but it seems to only return 0% or 100%. I’ve also looked into caching or custom records to track the execution progress manually. Question: What’s the best practice to implement this kind of real-time progress feedback? Is there a recommended way to track and display the actual progress percentage of a running Map/Reduce, like NetSuite does internally?
e
The API for retrieving/setting the percent complete value is just through the property
runtime.getCurrentScript().percentComplete
, not through a
getPercentComplete()
method. I'm not sure if this API applies in a Map/Reduce. How would you handle all the race conditions across concurrent processors during the
map
and
reduce
stages?
m
Het Eric thanks but how does netsuite manage the progress of scripts on standard pages (mainly running MRs)?
e
I can't answer how NetSuite does it internally
m