Vendor Prepayment
A Vendor Prepayment is a posting transaction that impacts the general ledger without offsetting the Accounts Payable account. When the vendor prepayment is applied, the Accounts Payable account is offset. The Vendor Prepayments feature records and tracks payments to vendors before they accept a purchase order for a good or service. You can apply these prepayment amounts against open bills for the vendor.
In NetSuite the vendor prepayment can be associated to a purchase order or not associated to a purchase order (standalone vendor prepayments.)
For help working with this record in the UI, see Entering Vendor Prepayments.
The internal ID for this record is vendorprepayment
.
For information about scripting with this record in SuiteScript, see the following help topics:
Supported Script Types
The vendor prepayment 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 permission. For information about vendor prepayment permissions, read Inventory Status.
Code Samples
The following example shows how to create a new vendor prepayment transaction for the payee with internal ID 94. The prepayment value is 500 units of the default payee currency:
-
SuiteScript 2.x
require(['N/record'], function(record) { function createAndSaveVendorPrepayment() { var objRecord = record.create({ type: 'vendorprepayment', isDynamic: true }); objRecord.setValue({ fieldId: 'entity', value: '94' }); objRecord.setValue({ fieldId: 'account', value: '151' }); objRecord.setValue({ fieldId: 'payment', value: '500' }); var recordId = objRecord.save(); } createAndSaveVendorPrepayment(); });
The following example shows how to update an existing vendor prepayment transaction with transaction ID 120:
-
SuiteScript 1.0
function updateVendorPrepayment() { var id = 120; var memo = 'Updated transaction memo'; var vendorPrepayment = nlapiLoadRecord('vendorprepayment', id); vendorPrepayment.setFieldValue('memo', memo); id = nlapiSubmitRecord(vendorPrepayment); }
-
SuiteScript 2.x
require(['N/record'], function(record) { function updateAndSaveVendorPrepayment() { var objRecord = record.load({ type: 'vendorprepayment', id: 120, isDynamic: true, }); objRecord.setValue({ fieldId: 'memo', value: 'Updated transaction memo 2' }); var recordId = objRecord.save(); } updateAndSaveVendorPrepayment(); });
The following example shows how to delete a vendor prepayment transaction with transaction ID 120:
-
SuiteScript 1.0
function deleteVendorPrepayment() { var id = 120; var vendorPrepayment = nlapiDeleteRecord('vendorprepayment', id); }
-
SuiteScript 2.x
require(['N/record'], function(record) { function deleteVendorPrepayment() { var objRecord = record.delete({ type: 'vendorprepayment', id: 120 }); } deleteVendorPrepayment(); });