I am trying to create deposit records, applying pa...
# suitescript
t
I am trying to create deposit records, applying payments to it, with setting disabledpaymentfilters to true. but it is not finding the lines with the payments. I am also using dynamic mode, could size of data impact this, it just showing 10000 in that list and not more than that, but there are more open payments and deposits and refunds. I have tried giving payments array as default filter as well, doesn’t work. It’s a map reduce script, so user filters shouldn’t work on it. However, everything works well in SBX, it’s the Production environment that is creating issue. There are around 5000 lines only in SBX on a deposit to select from. Here is the code snippet that does it, Dynamic mode, I cannot think of anything.
Copy code
if (settlement.paymentTransaction) {
          // Handle payment transactions
          const lineIndex = bankDepositRecord.findSublistLineWithValue({
            sublistId: 'payment',
            fieldId: 'id',
            value: settlement.paymentTransaction,
          });

          if (lineIndex != -1) {
            bankDepositRecord.selectLine({
              sublistId: 'payment',
              line: lineIndex,
            });
            bankDepositRecord.setCurrentSublistValue({
              sublistId: 'payment',
              fieldId: 'deposit',
              value: true,
            });
            bankDepositRecord.commitLine({ sublistId: 'payment' });
            log.debug(
              'Line Added to Bank Deposit',
              `Payment Transaction: ${settlement.paymentTransaction}, Line Index: ${lineIndex}`
            );
          } else {
            log.error(
              'Payment Transaction Not Found in Bank Deposit',
              `Payment Transaction ID: ${settlement.paymentTransaction}`
            );
          }
Tried with large orders, small orders in SBX, works smooth, it’s just PROD that is giving issue
b
use the
deposits
default value to limit the transactions to appear in the payment sublist
you can experiment with using the nsapiGetRecord function in client side code if you want to learn how I find these default values
t
I was using it initially and then it doesn’t seem to be doing anything, I thought it will select payments automatically. It didn’t and then I removed it. I’ll try again. I didn’t have this issue then though.
b
use the deposits default value in the ui first to see what it does. default values are usually query parameters in the url