How long does a record action task exist after com...
# suitescript
a
How long does a record action task exist after completing, before it is removed and can't have its status retrieved with task.checkStatus() ? I submitted one about 1/2 hour ago and it completed in seconds. Now passing the task ID to task.checkStatus() returns nothing.
โœ… 1
s
Could you inspect browser and check console for client side script? For server side script, you can check execution log in script deployment.
p
Record action task status is only stored temporarily in NetSuite. Once the task has completed and some time has passed, NetSuite clears it from the queue within a few minutes after completion. If itโ€™s been 30 minutes, the task ID will no longer be valid, which is why
task.checkStatus()
returns nothing.
โœ… 1
a
@Pandorahiccup That's what I suspected. Thank you for confirming. Is that expiration time in the documentation anywhere?
@Sherman Luong No I'm afraid not; the N/task module is not available to client scripting or browser console, only server-side implementations, so I built a simple suitelet where I can input the task Id and have it respond with the output of task.checkStatus().
p
Not specifically. NetSuite doesn't document an exact expiration window for task records but in practice they tend to expire within a few minutes after completion. The best approach is to capture and store the result right after the task finishes.
๐Ÿ‘ 2