Item Account Mapping

For accounts using Multi-Book Accounting, the item account mapping record enables you to configure secondary accounting books to post to accounts different from the primary book. These mappings are used by transactions where the item determines the account to which the transaction posts.

Using this record requires that, as part of your Multi-Book configuration, you select the Chart of Accounts Mapping option at Setup > Company > Enable Features, on the Accounting subtab, in addition to the other setup steps required for Multi-Book Accounting.

In the UI, you access this record at Setup > Accounting > Item Account Mappings > New.

For help working with this record in the UI, see Item Account Mapping.

The internal ID for this record is itemaccountmapping.

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

This record is scriptable in server SuiteScript only.

All three user events are supported: before Load, before Submit, and afterSubmit.

Supported Functions

The item account mapping record is fully scriptable, which means that it can be created, updated, copied, deleted, and searched using SuiteScript.

Code Samples

The following samples show how to create item account mapping records and perform other basic tasks.

          // Get Record
var itemMapRec1 = record.load({
    type: record.Type.ITEM_ACCOUNT_MAPPING,
    id: '105'
});
// Create Record
var itemMapRec2 = record.create({
    type: record.Type.ITEM_ACCOUNT_MAPPING
});
itemMapRec2.setValue({
    fieldId: 'effectivedate',
    value: new Date('4/4/2004')
});
itemMapRec2.setValue({
    fieldId: 'accountingbook',
    value: '2'
});
itemMapRec2.setValue({
    fieldId: 'sourceaccount',
    value: '118'
});
itemMapRec2.setText({
    fieldId: 'itemaccount',
    text: 'Asset'
});
itemMapRec2.setValue({
    fieldId: 'subsidiary',
    value: '3'
});
itemMapRec2.setText({
    fieldId: 'class',
    text: 'Class US'
});
itemMapRec2.setText({
    fieldId: 'department',
    text: 'Department  US'
});
itemMapRec2.setText({
    fieldId: 'location',
    text: 'Location US'
});
itemMapRec2.setValue({
    fieldId: 'destinationaccount',
    value: '118'
});
var id = itemMapRec2.save();

// Update Record
var itemMapRec3 = record.load({
    type: record.Type.ITEM_ACCOUNT_MAPPING,
    id: '201'
})
itemMapRec3.setValue({
    fieldId: 'effectivedate',
    value: new Date('5/5/2005')
});
itemMapRec3.setValue({
    fieldId: 'subsidiary',
    value: '1'
});
itemMapRec3.setText({
    fieldId: 'itemaccount',
    text: 'Discount'
});
itemMapRec3.setText({
    fieldId: 'sourceaccount',
    text: 'Advertising'
});
itemMapRec3.setText({
    fieldId: 'destinationaccount',
    text: 'Advertising'
});
var id = itemMapRec3.save();

// Copy Record
var itemMapRec4 = record.copy({
    type: record.Type.ITEM_ACCOUNT_MAPPING,
    id: '201'
});
itemMapRec4.setValue({
    fieldId: 'effectivedate',
    value: new Date('6/6/2005')
});
itemMapRec4.setText({
    fieldId: 'itemaccount',
    text: 'Asset'
});
itemMapRec4.setValue({
    fieldId: 'sourceaccount',
    value: '118'
});
itemMapRec4.setValue({
    fieldId: 'destinationaccount',
    value: '118'
});
var id = itemMapRec4.save();

// Delete Record
var delrecId = record.delete({
    type: record.Type.ITEM_ACCOUNT_MAPPING,
    id: '201'
}); 

        

Related Topics

General Notices