N/transaction Module for Voiding Transactions in NetSuite
The N/transaction module allows developers to void transactions in NetSuite by setting totals to zero while preserving audit trails.
The N/transaction module is a crucial component for developers working with transaction management in NetSuite, specifically designed to void transactions. Voiding a transaction sets its total and all line items to zero without removing it from the system, making it an effective way to cancel existing transactions while maintaining an audit trail.
Why Use Voiding?
Voiding is often preferred over deleting transactions because it preserves the historical accuracy of the accounts involved. Once a transaction is voided, modifications that affect the general ledger are no longer possible. Voiding also behaves differently based on account settings:
- Direct Voids: Occur if the 'Using Reversing Journals' preference is disabled.
- Voids by Reversing Journal: Are performed when this preference is enabled.
Voiding Procedure
To void a transaction:
- Open the transaction for editing.
- Click on the Void button.
If the reversing journal preference is enabled, be aware that only certain transaction types can be voided. This setup can often be verified under the accounting preferences settings.
Key Module Members
The following table outlines the important members of the N/transaction module useful for voiding transactions:
| Member Name | Type | Return Type | Supported Script Types | Description |
|---|---|---|---|---|
transaction.void(options) | Method | number | Client and server scripts | Voids a transaction record. |
transaction.void.promise(options) | Method | number | Client and server scripts | Voids a transaction record asynchronously. |
transaction.Type | Enum | enum | Client and server scripts | Holds string values for supported record types. |
Example Script for Voiding a Sales Order
The following SuiteScript demonstrates how to void a sales order transaction after configuring the accounting preferences correctly:
1/**2 * @NApiVersion 2.x3 */4 5require(['N/transaction', 'N/config', 'N/record'], function(transaction, config, record) {6 function voidSalesOrder() {7 var accountingConfig = config.load({8 type: config.Type.ACCOUNTING_PREFERENCES9 });10 accountingConfig.setValue({11 fieldId: 'REVERSALVOIDING',12 value: false13 });14 15 accountingConfig.save();16 17 var salesOrderObj = record.create({18 type: 'salesorder',19 isDynamic: false20 });21 salesOrderObj.setValue({22 fieldId: 'entity',23 value: 10724 });25 // Additional logic to populate and save the sales order before voiding...26 }27});This sample assumes that users modify the hard-coded record ID to match their NetSuite environment.
Who This Affects
- Developers who implement transaction handling in NetSuite
- Accountants managing financial records and transactions
- Administrators configuring accounting preferences
Key Takeaways
- The N/transaction module is essential for voiding transactions.
- Voiding maintains an audit trail, which is crucial for regulatory compliance.
- The type of void action is determined by account preferences.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Can the N/transaction module be used to void any transaction type in NetSuite?
Does voiding a transaction impact the general ledger in NetSuite?
What steps must be taken before voiding a sales order using the N/transaction module?
How do 'Direct Voids' differ from 'Voids by Reversing Journal' when using the N/transaction module?
Was this article helpful?
More in Accounting
- Intelligent Close Manager Portlet in NetSuite
The Intelligent Close Manager portlet offers a centralized view for managing tasks and exceptions in NetSuite, enhancing close processes.
- Applied Trans Date and Period Enhancements in NetSuite 20...
Latest updates in NetSuite 2024.1 enhance Accounting SuiteApps with transaction line distribution features.
- Journal Line Sublists Standardized for NetSuite 2026.1
With NetSuite 2026.1, journal line sublists are standardized to keyed configurations, allowing precise line updates and enhancing financial accuracy.
- Deployment Considerations for NFP SuiteApps in NetSuite
Understand the key deployment considerations for NFP SuiteApps to ensure successful installation and updates.
