如何在NetSuite中查找与客户退款相关的客户存款
我有客户退款记录,现在我需要查找相关的客户存款记录?我在SuiteScript记录浏览器中查看过,但没有看到用于连接记录的数据字段 谢谢,如何在NetSuite中查找与客户退款相关的客户存款,netsuite,Netsuite,我有客户退款记录,现在我需要查找相关的客户存款记录?我在SuiteScript记录浏览器中查看过,但没有看到用于连接记录的数据字段 谢谢, Russ如果您仍在尝试处理特定销售订单的押金,您可以进行简单搜索: nlapiSearchRecord('customerdeposit', null, new nlobjSearchFilter('createdfrom', null, 'is', 1217)); //1217 is internal id of original sales order
Russ如果您仍在尝试处理特定销售订单的押金,您可以进行简单搜索:
nlapiSearchRecord('customerdeposit', null, new nlobjSearchFilter('createdfrom', null, 'is', 1217));
//1217 is internal id of original sales order
但是,如果您仍然要求退还特定的押金,您还应该知道正确创建客户退款的方法仍然没有记录:
var cr = nlapiCreateRecord('customerrefund',{entity:127}); // id of customer
cr.setFieldValue('paymentmethod', 1);
//may need to cycle through deposit lines to find the right one(s)
//cr.setLineItemValue('deposit', 'doc', 1, '1226');
//cr.setLineItemValue('deposit', 'amount', 1, 500);
cr.setLineItemValue('deposit', 'apply', 1, 'T'); // need this for at least one line.
nlapiSubmitRecord(cr);
如果你想再次找到受影响的存款,那就很奇怪了。如果您可以从退款的文件编号开始,您将收集应用该编号的交易的ID,然后获取应用该编号的交易:
var appliedIds = nlapiSearchRecord('customerrefund', null, [new nlobjSearchFilter('tranid', null, 'is', '2073'),
new nlobjSearchFilter('applyingtransaction', null, 'noneof', ['@NONE@'])
], [
new nlobjSearchColumn('tranid'),
new nlobjSearchColumn('applyingtransaction'),
new nlobjSearchColumn('applyinglinktype')
]).map(function(cr) {
console.log(cr.getValue('deposit', 'applying'));
console.log(cr.getValue('applyinglinktype'));
if ('payment' == cr.getValue('applyinglinktype')) {
return cr.getValue('applyingtransaction');
}
return null;
}).filter(function(id) {
return id;
});
nlapiSearchRecord('depositapplication', null, [
new nlobjSearchFilter('internalid', null, 'anyof', appliedIds),
new nlobjSearchFilter('appliedtolinktype', null, 'anyof', ['DepAppl'])
], new nlobjSearchColumn('appliedtotransaction')).
forEach(function(da) {
console.log(da.getValue('appliedtotransaction'));
});
如果您仍在尝试处理特定销售订单的押金,您可以进行简单搜索:
nlapiSearchRecord('customerdeposit', null, new nlobjSearchFilter('createdfrom', null, 'is', 1217));
//1217 is internal id of original sales order
但是,如果您仍然要求退还特定的押金,您还应该知道正确创建客户退款的方法仍然没有记录:
var cr = nlapiCreateRecord('customerrefund',{entity:127}); // id of customer
cr.setFieldValue('paymentmethod', 1);
//may need to cycle through deposit lines to find the right one(s)
//cr.setLineItemValue('deposit', 'doc', 1, '1226');
//cr.setLineItemValue('deposit', 'amount', 1, 500);
cr.setLineItemValue('deposit', 'apply', 1, 'T'); // need this for at least one line.
nlapiSubmitRecord(cr);
如果你想再次找到受影响的存款,那就很奇怪了。如果您可以从退款的文件编号开始,您将收集应用该编号的交易的ID,然后获取应用该编号的交易:
var appliedIds = nlapiSearchRecord('customerrefund', null, [new nlobjSearchFilter('tranid', null, 'is', '2073'),
new nlobjSearchFilter('applyingtransaction', null, 'noneof', ['@NONE@'])
], [
new nlobjSearchColumn('tranid'),
new nlobjSearchColumn('applyingtransaction'),
new nlobjSearchColumn('applyinglinktype')
]).map(function(cr) {
console.log(cr.getValue('deposit', 'applying'));
console.log(cr.getValue('applyinglinktype'));
if ('payment' == cr.getValue('applyinglinktype')) {
return cr.getValue('applyingtransaction');
}
return null;
}).filter(function(id) {
return id;
});
nlapiSearchRecord('depositapplication', null, [
new nlobjSearchFilter('internalid', null, 'anyof', appliedIds),
new nlobjSearchFilter('appliedtolinktype', null, 'anyof', ['DepAppl'])
], new nlobjSearchColumn('appliedtotransaction')).
forEach(function(da) {
console.log(da.getValue('appliedtotransaction'));
});
我还没有机会尝试这个,但它看起来像我一直在寻找的。我还没有机会尝试这个,但它看起来像我一直在寻找的。