Unable to find a matching line for sublist apply w...
# ask-stanley-ai
y
Unable to find a matching line for sublist apply with key: [doc bill payment
c
AI generated answer (using internal Slack threads):
The error "Unable to find a matching line for sublist apply with key: [doc,line]" typically occurs when NetSuite is unable to find a bill to pay in the exact amount of the payment you are uploading. If there is even one incorrect line in your payment CSV file, the entire file will fail to upload. If you are matching by external ID, it's recommended to run a saved search against the bills you are trying to import against, and expose the External ID for the lines. Ensure that these match your upload file of Bill Payments. If you are trying this process on lines you have never done it for previously, it’s possible they don’t have external IDs. When transforming a
vendorbill
into a
vendorpayment
, the apply sublist should contain all open bills for the vendor, with the apply column set to 'F', besides for the bill you transformed from which will default to apply = T. Here is a sample code for this transformation:
Copy code
javascript
var vendPayment = record.transform({
        fromType: vendBill.type,
        fromId: vendBill.id,
        toType: record.Type.VENDOR_PAYMENT,
        isDynamic: true
      });
vendPayment.save();
However, the vendor payment sublist is a static list, so you cannot insert a new line like you are trying to do with
vendPayment.insertLine
. If the apply sublist doesn't have any open bills for the vendor, it might be because there are no open bills for that vendor. ****** 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.886679173
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849479198
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842630565
Please provide your feedback on this answer.