When creating a deposit, does NetSuite care that t...
# ask-stanley-ai
m
When creating a deposit, does NetSuite care that the type in the payment list is correct? or will it auto resolve CustomerDeposit, if passed CustPymt? and would passing the wrong type cause Unable to find a matching line for sublist apply with key? Why does the wrong type work sometimes?
c
AI generated answer (using internal Slack threads):
When creating a deposit in NetSuite, the system does care about the type in the payment list being correct. If you pass 'CustPymt' instead of 'CustomerDeposit', it may cause the error 'Unable to find a matching line for sublist apply with key'. This is because NetSuite uses the type to determine the correct sublist and line item to apply the payment or deposit to. However, there may be instances where passing the wrong type seems to work. This could be due to the automatic application feature in NetSuite. If this feature is enabled, when a related invoice is generated, the system may automatically apply the deposit or payment, regardless of the type passed. When creating a Customer Payment using SuiteScript, you can select a deposit using the 'doc' id. Here's an example of how you might do this:
Copy code
javascript
let pymtRec = record.create({type:record.Type.CUSTOMER_PAYMENT, isDynamic:true});
// Assume 'doc' is the id of the deposit you want to select
pymtRec.selectLine({sublistId: 'deposit', line: doc});
Please note that if a deposit was created from a Sales Order using the "Create Deposit" button, it should automatically apply when the Sales Order is invoiced. ****** 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.836486816
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832702637
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831542969
Please provide your feedback on this answer.