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.

·2 min read·View Oracle Docs

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:

  1. Open the transaction for editing.
  2. 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 NameTypeReturn TypeSupported Script TypesDescription
transaction.void(options)MethodnumberClient and server scriptsVoids a transaction record.
transaction.void.promise(options)MethodnumberClient and server scriptsVoids a transaction record asynchronously.
transaction.TypeEnumenumClient and server scriptsHolds 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:

suitescript
1/**
2 * @NApiVersion 2.x
3 */
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_PREFERENCES
9 });
10 accountingConfig.setValue({
11 fieldId: 'REVERSALVOIDING',
12 value: false
13 });
14
15 accountingConfig.save();
16
17 var salesOrderObj = record.create({
18 type: 'salesorder',
19 isDynamic: false
20 });
21 salesOrderObj.setValue({
22 fieldId: 'entity',
23 value: 107
24 });
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?
The N/transaction module can void certain transaction types, depending on the 'Using Reversing Journals' preference in accounting settings. It's important to ensure that the transaction type supports voiding with the current configuration.
Does voiding a transaction impact the general ledger in NetSuite?
Once a transaction is voided, modifications that affect the general ledger are no longer possible, preserving the transaction in historical accounts for audit purposes.
What steps must be taken before voiding a sales order using the N/transaction module?
Before voiding a sales order, ensure that the accounting preferences such as 'Using Reversing Journals' are configured correctly to match the desired void method.
How do 'Direct Voids' differ from 'Voids by Reversing Journal' when using the N/transaction module?
Direct voids occur if the 'Using Reversing Journals' preference is disabled, while voids by reversing journal are performed when this preference is enabled. This setting determines the voiding behavior for transactions.
Source: N/transaction Module Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Accounting

View all Accounting articles →