Hey guys! I am making a script that creates a cust...
# general
a
Hey guys! I am making a script that creates a customer payment for a bunch of invoices. The script will load a CSV file that has a list of Invoice Internal ids. When I go to create the line items for the applied to tab I am getting an error message “You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.”  customerPayment.selectNewLineItem('apply')  customerPayment.setCurrentLineItemValue('apply', 'internalid', 1747898)   customerPayment.commitLineItem('apply') Any insight would be greatly appreciated!(Going to be re-writing this script into 2.0 while I wait and see if anyone has any suggestions.)
b
your code is doing the equivalent of adding new lines to a customer payment
thats not what you would do in the ui
in the ui, you edit an existing line
you do the same thing in script
k
why not just use a CSV import for this?
you can have a script utilize a CSV import.