Multi-Book Accounting Transaction

Note:

This topic applies to all versions of SuiteScript.

If your account has the Multi-Book Accounting feature enabled, you can use SuiteScript to search for transactions using accounting book as a search filter or a search column. To execute this type of search, you use the multi-book accounting transaction search record.

In the UI, you can view the multi-book accounting transaction search by going to Reports > New Search and clicking Multi-Book Accounting Transaction.

For help working with this record in the UI, see Multi-Book Accounting.

The internal ID for this record is accountingtransaction. Note that this record is a search record only. You cannot create or copy this record.

See the SuiteScript Records Browser for all internal IDs associated with this record.

Note:

For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.

For information about scripting with this record in SuiteScript, see the following help topics:

Supported Script Types

The multi-book accounting transaction record is supported in both client and server SuiteScript.

Supported Functions

Only search is supported for this record.

Sample Code

The following sample shows how to search for a specific transaction and include in the results details about the transaction’s accounting book and foreign exchange rate, among other data.

          var mySearch = search.create ({
    type: search.Type.TRANSACTION,
    columns: [{
        name: 'accountingbook',
        sort: search.Sort.ASC
    }, {
        name: 'line',
        join: 'transaction',
        sort: search.Sort.ASC
    }, {
        name: 'account'
    }, {
        name: 'amount'
    }, {
        name: 'exchangerate'
    }],
    filters: [{
        name: 'internalid',
        operator: search.Operator.IS,
        values: 18                      // last parameter represents the internal ID of the transaction
    }],
});

for (var i = 0; mySearch != null && i < mySearch.length; i++ ){
    var searchresult = mySearch[i];
    var record = searchresult.getId();
    var rectype = searchresult.getRecordType();
    var book = searchresult.getValue({
        name: 'accountingbook'
    });
    var line = searchresult.getValue({
        name: 'line',
        join : 'transaction'
    });
    var account = searchresult.getValue({
        name:'account'
    });
    var amount= searchresult.getValue({
        name: 'amount'
    }); 
    var fxrate= searchresult.getValue({
        name: 'exchangerate'
    });

    alert(i + ": " + book + " | " + line + " | " + record + " | " + rectype + " | " + account + " | " + amount + " | " + fxrate);
} 

        

Related Topics

General Notices