Void a payment using N/transaction
In NetSuite, the N/transaction module allows you to programmatically void transactions, such as payments or invoices. Using the void function, you can efficiently reverse the impact of a transaction. This is useful for handling corrections or cancellations directly within scripts.
transaction.void({
type: transaction.Type.VENDOR_PAYMENT, // Make sure the preference 'Void Transactions Using Reversing Journals' is disabled in Account Preferences
id: Rec.id
});
