Marwan
10/04/2023, 3:20 AMlet searchTask = task.create({
taskType: task.TaskType.SEARCH,
});
searchTask.savedSearchId = srchID;
searchTask.filePath =
"CustomersMonthlyReports/" +
year +
"/" +
monthNames[month] +
"/tranid_" +
invoice.getValue("tranid") +
"_internalid_" +
invoiceID +
".csv";
searchTask.submit();
Some columns have Arabic text, it looks as in the attached image, you have to do some steps in Excel to view it correctly.
I don't want to ask the user to do these steps. I googled the problem, some suggested say you just need to use utf-8-sig
, but NS doesn't have that. I tried also to save the file as xls
and xlsx
but Excel responds with an error for one, and the other doesn't show Arabic text correctly too.
Can this be handled using scripts, or it has to be from Excel or Windows?
ThanksAnthony OConnor
10/04/2023, 4:12 AMAnthony OConnor
10/04/2023, 4:16 AMAnthony OConnor
10/04/2023, 4:19 AMAnthony OConnor
10/04/2023, 4:25 AMsearchTask.filePath
generate an empty file first with that dynamic path and name
and set the encoding on the file to utf-8.
//Add additional code
...
var fileObj = file.create({
name: fileName,
fileType: file.Type.CSV,
encoding: file.Encoding.UTF_8,
folder: folder,
});
and then run your search task using searchTask.fileId = fileObj
insteadAnthony OConnor
10/04/2023, 4:27 AMChris Corcoran
10/04/2023, 9:08 AMMarwan
10/04/2023, 3:33 PMgenerate an empty file first@Anthony OConnor I didn't think of that idea, I was changing the encoding to utf-8 before sending the file. I will try it. Thanks.
Marwan
10/04/2023, 3:34 PM