Vendor Prepayment Application
After you make a prepayment to a vendor, you must apply the prepayment against the vendor bills. A vendor prepayment application is a posting transaction that impacts the general ledger. The Prepayment account is credited, offsetting the Accounts Payable account. The application decreases the total amount you must pay to your vendor.
You can apply the prepayment manually, or configure NetSuite to apply the prepayment automatically using the Auto-Apply accounting preference.
For help working with this record in the UI, see Vendor Prepayment Application.
The internal ID for this record is vendorprepaymentapplication
.
For information about scripting with this record in SuiteScript, see the following help topics:
Supported Script Types
The vendor prepayment application record is scriptable in both client and server SuiteScript.
Supported Fields
For all the internal IDs associated with this record, see the SuiteScript Records Browser.
For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.
Usage Notes
The script user must have the required permission level for the Vendor Prepayment Application permission. For information about vendor prepayment permissions, read Configuring Permissions for Vendor Prepayments.
Code Samples
The following example shows how to transform a vendor prepayment transaction into the vendor prepayment application. The transformation process applies the vendor prepayment. This transformation is required because a vendor prepayment application requires a vendor prepayment.
-
SuiteScript 2.x
This example shows an application of the vendor prepayment with ID 718. During the application, the first vendor bill is selected for application.
require(['N/record'], function(record) { function transformVendorPrepayment() { var vendorPrepaymentApplication = record.transform({ fromType: 'vendorprepayment', fromId: 718, toType: 'vendorprepaymentapplication', isDynamic: true, }); vendorPrepaymentApplication.selectLine({ sublistId: 'bill', line: 0 }); vendorPrepaymentApplication.setCurrentSublistValue({ sublistId: 'bill', fieldId: 'apply', value: true }); vendorPrepaymentApplication.commitLine({ sublistId: 'bill' }); var vendorPrepaymentApplicationId = vendorPrepaymentApplication.save(); } transformVendorPrepayment(); });