When creating a bank deposit, does NetSuite care t...
# ask-stanley-ai
m
When creating a bank deposit, does NetSuite care that the type of records in the deposit payment list is correct? or will it auto resolve an id of a CustDep, if passed CustPymt as its type? This works sometimes even with wrong type but it seems for some records we get an "Unable to find a matching line for sublist apply with key" error when we upsert using SOAP api
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that when creating a bank deposit in NetSuite, the system does care about the type of records in the deposit payment list. If you pass a CustDep as a CustPymt type, it may sometimes work, but it can also lead to errors such as "Unable to find a matching line for sublist apply with key". The error "Unable to find a matching line for sublist apply with key" usually occurs when the system is unable to find a matching line in the sublist for the key provided. This could be due to a mismatch in the type of record passed and the type expected by the system. In the context of creating a bank deposit, you need to ensure that you are passing the correct type of record in the deposit payment list. If you are using SuiteScript, you can use the
record.findSublistLineWithValue
method to find the line number for the payment to apply. Here is a code snippet from the conversation:
Copy code
javascript
var lineNumber = depositRecord.findSublistLineWithValue({
    sublistId: 'payment',
    fieldId: 'id',
    value: relTransId
});
depositRecord.setSublistValue({
    sublistId: 'payment',
    fieldId: 'id',
    line: lineNumber,
    value: relTransId,
});
depositRecord.setSublistValue({
    sublistId: 'payment',
    fieldId: 'deposit',
    line: lineNumber,
    value: true,
});
In this code,
relTransId
is the ID of the record you want to deposit. The
findSublistLineWithValue
method is used to find the line number of the payment in the 'payment' sublist. Then, the
setSublistValue
method is used to set the 'id' and 'deposit' fields of the payment line. Remember to always ensure that the types of records you are passing match the types expected by the system to avoid errors. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843017578
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836120605
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834289551
Please provide your feedback on this answer.