Hi all I am looking for some help with my RESTlet....
# general
l
Hi all I am looking for some help with my RESTlet. I created a restlet that uses task.create to export the results of a saved search to a folder in the file cabinet, and then email that file to a user based on the input. The issue I am running into is that it doesn't seem like task.create is async so the email to the user is sent before the file has been updated. Can someone help me out wih this?
var searchTask = task.create({
taskType: task.TaskType.SEARCH,
savedSearchId: '1587',
filePath: 'lead_storage/search_results.csv'
}).submit();
var taskStatus = task.checkStatus({
taskId: searchTask
});
if (taskStatus.status === task.TaskStatus.COMPLETE){ email the file... }
e
I’d recommend posting this one to the #C29HQS63G channel instead. But, it looks like you could use the addInboundDependencies method to fire another script when the results of your async task is complete. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1530711128.html
l
Thanks for the input, I'll do that