Hi everyone, I've created a restlet to update a ve...
# suitescript
a
Hi everyone, I've created a restlet to update a vendor prepayment application record. This is my code:
Copy code
// Load the Vendor Prepayment Application
            var vendorPrepaymentApplication = record.load({
                type: record.Type.VENDOR_PREPAYMENT_APPLICATION,
                id: vendorPrepaymentApplicationId
            });

            vendorPrepaymentApplication.selectLine({
               sublistId: 'bill',
               line: 0
            });

            vendorPrepaymentApplication.setCurrentSublistValue({
                sublistId: 'bill',
                fieldId: 'amount',
                value: depositAmount // Update amount applied to Bill
            });

            vendorPrepaymentApplication.commitLine({
                sublistId: 'bill'
            }); // Commit Current Line

            // Save the Vendor Payment
            var restletOutput = vendorPrepaymentApplication.save();
But I'm getting this error:
"Cannot find function selectLine in object standard record."
I've checked the docs and selectLine is definitely a function for
vendorPrepaymentApplication
. Am I doing something wrong?
b
Record.setCurrentSublistValue documentation tells you what mode it requires (and the alternative to use instead)
a
It worked! Thank you 😄