我試圖打電話給通過的Restlet API保存的搜索和我有我的Restlet部署,但試圖運行它的時候,我發現了以下錯誤:NetSuite公司的Restlet錯誤代碼:INVALID_RETURN_DATA_FORMAT
error code: INVALID_RETURN_DATA_FORMAT
error message:Invalid data format. You should return TEXT.
通過我的腳本查看,我無法確定錯誤的位置。以下是我正在嘗試運行的腳本
function GetSearchResult(){
//array container for search results
var output = new Array();
//get search results
var results = nlapiSearchRecord('transaction','customsearchid',null,null);
var columns = results[0].getAllColumns();
//loop through the search results
for(var i in results){
//create placeholder object place holder
var obj = new searchRow(
//set the values of the object with the values of the appropriate columns
results[i].getValue(columns[0]),
results[i].getValue(columns[1]),
results[i].getValue(columns[2]),
results[i].getValue(columns[3]),
results[i].getValue(columns[4]),
results[i].getValue(columns[5]),
results[i].getValue(columns[6]),
results[i].getValue(columns[7]),
results[i].getValue(columns[8]),
results[i].getValue(columns[9]),
results[i].getValue(columns[10]),
results[i].getValue(columns[11]),
results[i].getValue(columns[12])
);
//add the object to the array of results
output.push(obj);
}
//return the array of search objects
return output;
}
//Object to serve a place holder for each search row
function searchRow(internalid,lineid,subsidiaryid,locationid,departmentid,accountid,date,name,memo,amount,uniqueid,product,period){
this.internalid = internalid;
this.lineid = lineid;
this.subsidiaryid = subsidiaryid;
this.locationid = locationid;
this.departmentid = departmentid;
this.accountid = accountid;
this.date = date;
this.name = name;
this.memo = memo;
this.amount = amount;
this.uniqueid = uniqueid;
this.product = product;
this.period = period;
}
謝謝!
添加內容類型標頭完美地工作,謝謝! – Ryan