Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在NetSuite中查找与客户退款相关的客户存款_Netsuite - Fatal编程技术网

如何在NetSuite中查找与客户退款相关的客户存款

如何在NetSuite中查找与客户退款相关的客户存款,netsuite,Netsuite,我有客户退款记录,现在我需要查找相关的客户存款记录?我在SuiteScript记录浏览器中查看过,但没有看到用于连接记录的数据字段 谢谢, Russ如果您仍在尝试处理特定销售订单的押金,您可以进行简单搜索: nlapiSearchRecord('customerdeposit', null, new nlobjSearchFilter('createdfrom', null, 'is', 1217)); //1217 is internal id of original sales order

我有客户退款记录,现在我需要查找相关的客户存款记录?我在SuiteScript记录浏览器中查看过,但没有看到用于连接记录的数据字段

谢谢,
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'));
});

我还没有机会尝试这个,但它看起来像我一直在寻找的。我还没有机会尝试这个,但它看起来像我一直在寻找的。