我在通过Restlet获取客户记录的老化信息时遇到了问题。具体而言,我希望从给定客户的客户表单中获取老化、aging1、aging2、aging3和aging4字段。
在UI中,这些值可以在"Financial“部分下的Customer表单中找到,如下所示:
Current 1-30 Days 31-60 Days 61-90 Days Over 90 Days
1200.00 800.00 720.37 423.23 42.00我的Restlet代码如下所示:
…
cols[6] = new nlobjSearchColumn('aging');
var result = nlapiSearchRecord(data.record_type, null, filter, cols);
return result;它适用于其他字段,如"balance",但当我包含“老化”字段并运行GET时,我会看到以下错误:
"error": {
"code": "SSS_INVALID_SRCH_COL",
"message": "An nlobjSearchColumn contains an invalid column, or is not in proper syntax: aging."
}很明显我做得不对。这些领域在某种程度上是特殊的吗?如何检索这些值?
发布于 2015-08-04 19:55:50
很容易添加到合适的文本上下文中。例如:
var aging = nlapiSearchRecord('invoice', null, [
new nlobjSearchFilter('daysoverdue', null, 'greaterthan', 0),
new nlobjSearchFilter('mainline', null, 'is', 'T'),
new nlobjSearchFilter('amountremaining', null, 'greaterthan', 0)
//for your RESTLet maybe you need this: , new nlobjSearchFilter('entity', null, 'is', data.customer_id)
], [
new nlobjSearchColumn('entity', null, 'group'),
new nlobjSearchColumn('formulanumeric', null, 'sum').setFormula('case when {daysoverdue} < 31 then {amountremaining} else 0 end'),
new nlobjSearchColumn('formulanumeric', null, 'sum').setFormula('case when {daysoverdue} between 31 and 60 then {amountremaining} else 0 end'),
new nlobjSearchColumn('formulanumeric', null, 'sum').setFormula('case when {daysoverdue} between 61 and 90 then {amountremaining} else 0 end'),
new nlobjSearchColumn('formulanumeric', null, 'sum').setFormula('case when {daysoverdue} > 90 then {amountremaining} else 0 end')
]);
aging.forEach(function (inv) {
var cols = inv.getAllColumns();
console.log(inv.getText('entity', null, 'group') +
' 0-30: ' + inv.getValue(cols[1]) +
' 31-60: ' + inv.getValue(cols[2]) +
' 61-90: ' + inv.getValue(cols[3]) +
' > 90: ' + inv.getValue(cols[4]));
});发布于 2015-08-01 06:40:54
据我所知,没有所谓“老化”的客户搜索栏。这是无效搜索列错误的原因。
此外,这些字段也可能不会暴露在搜索或文本中,这就是为什么您要得到错误。
发布于 2015-08-04 16:50:48
实际上,我联系了Netsuite,之前的评论是正确的,这些字段没有公开,所以我不能使用它们。
目前有一个增强请求#238854来公开这些字段。
https://stackoverflow.com/questions/31756717
复制相似问题