【发布时间】:2016-12-09 04:40:56
【问题描述】:
我想加载一个现有文件并附加一些数据,然后将其保存回来。在 SuiteScript 2.0 中尝试了以下操作。但是下面的代码仍然给了我旧的文件内容(只有创建时的第一行!)。怎么了?
var fileObj = file.load({
id:'SuiteScripts/MergeVendorResults/'+'MergeResult_'+recordId+'.txt'
});
var oldFileContents = fileObj.getContents();
log.debug("Existing file contents","Old File Contents -> "+oldFileContents);
fileObj.contents = oldFileContents + "\n"+ fileContents;
var id = fileObj.save();
fileObj = file.load({
id: id
});
log.debug("Existing file replaced with contents","File Contents -> "+fileObj.getContents());
【问题讨论】:
标签: netsuite suitescript