i create a file and save it with search results. t...
# suitescript
v
i create a file and save it with search results. then i load the file to remove the header of the results. Below is my code, var savedSearchID = runtime.getCurrentScript().getParameter({name: 'custscript_saved_search_parameter'}); var folderID = runtime.getCurrentScript().getParameter({name: 'custscript_folder_parameter'}); var timeStamp = new Date().getTime(); var fileName = 'Saved Search - ' + timeStamp + '.csv'; var csvFile = file.create({ name : fileName, fileType : file.Type.CSV, folder : folderID, isOnline : true }); var csvFileID = csvFile.save(); log.debug('csvfileid',csvFileID); var searchTask = task.create({ taskType : task.TaskType.SEARCH }); searchTask.savedSearchId = savedSearchID; searchTask.fileId = csvFileID; var searchTaskId = searchTask.submit(); log.debug('id',searchTaskId); var taskStatus = task.checkStatus({ taskId : searchTaskId }); log.debug('taskstatus',taskStatus); now when i try to load the file, it shows empty in the script, but the file is there in the file cabinet already meaning it takes time to populate. what could i do to load the file?
b