StandardLine
Type |
Object |
Description |
Contains all properties for a single standard line on the GL impact on a transaction. Use the methods available to the StandardLine object to get the values for the standard line and define plug-in implementation functionality based on the values. The StandardLines object has a StandardLine object for each standard GL impact line. |
Methods |
Note:
The StandardLine and CustomLine objects share some common methods. For more information, see Common StandardLine and CustomLine Object Methods. |
Parent Object(s) |
|
Child Object(s) |
n/a |
getEntityId()
Function Declaration |
|
Type |
Object method |
Description |
Returns the internal NetSuite ID of the entity for a standard line. The entity can be any customer, employee, partner, or vendor, depending on the type of transaction. You can use this ID, for example, to define plug-in implementation functionality based on the entity ID, to load the record for the entity with See also Record.
Important:
Limit the use of these APIs, where possible, to improve performance of the plug-in implementation. Also, searching for a record results in better performance than loading the record. To implement functionality based on the entity ID, you can use helper functions to avoid adding the internal NetSuite ID into the plug-in implementation logic. See Utility Files for a Custom GL Lines Plug-In Implementation. |
Returns |
int |
Input Parameters |
None. |
Parent object |
Example 1: Loading the Record
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
var recType = transactionRecord.getRecordType();
if (recType == 'salesorder')
{
var custRecord = nlapiLoadRecord('customer',currLine.getEntityId());
// get record properties here
...
}
...
}
}
Example 2: Searching for the Record
// utility function
function searchNeededPropertiesOfCustomer(customerId)
{
var searchFilters = new Array();
searchFilters[0] = new nlobjSearchFilter('internalid', null, 'anyof', customerId);
var savedSearchResults = nlapiSearchRecord('customer', 'customsearch_script_id', searchFilters);
if (savedSearchResults != null && savedSearchResults.length > 0)
{
return savedSearchResults[0];
}
return null;
}
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
var recType = transactionRecord.getRecordType();
if (recType == 'salesorder')
{
// nlobjSearchResult
var custMap = searchNeededPropertiesOfCustomer(currLine.getEntityId());
// get search columns here
...
}
...
}
}
getId()
Function Declaration |
|
Type |
Object method |
Description |
Returns the internal NetSuite database ID for a standard GL impact line. The summary line for the GL impact on a transaction occurs for most transaction types at ID of 0. Some transactions, like journals, do not have a summary line. You can use the summary information to define plug-in implementation functionality based on the values in the summary line.
Note:
The summary line for the GL impact on a transaction does not include tax information. |
Returns |
int |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
if (currLine.getId() == 0)
{
// it's a summary line
}
...
}
}
getSubsidiaryId()
Function Declaration |
|
Type |
Object method |
Description |
Returns the internal NetSuite ID of the subsidiary for the entity associated with a standard GL impact line. You can view all subsidiaries and the associated internal IDs in NetSuite at Setup > Company > Subsidiaries. You can use this ID, for example, to define plug-in implementation functionality based on the subsidiary ID, to load the record for the subsidiary with The type parameter for a subsidiary is
Important:
Limit the use of these APIs, where possible, to improve performance of the plug-in implementation. Also, searching for a record results in better performance than loading the record. You can use helper functions in a utility file to avoid adding the internal NetSuite IDs into the plug-in implementation logic. See Utility Files for a Custom GL Lines Plug-In Implementation. |
Returns |
int |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
var subId = currLine.getSubsidiaryId();
...
var subRecord = nlapiLoadRecord('subsidiary',subId,'');
...
}
...
}
}
getTaxableAmount()
Function Declaration |
|
Type |
Object method |
Description |
Returns a string that represents the amount of a standard GL line that was subject to tax. Returns 0 if the line was not subject to tax. Use this method with getTaxAmount(), getTaxItemId(), and getTaxType() to get the tax information for a standard GL impact line. You can use helper functions in a utility file to avoid adding the internal NetSuite IDs into the plug-in implementation logic. See Utility Files for a Custom GL Lines Plug-In Implementation. |
Returns |
string |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
// check tax
if (currLine.getTaxItemId() != -7) // taxable transaction
{
var taxType = currLine.getTaxType();
if (taxType == "US_ST")
{
// process state taxes
var taxAmt = currLine.getTaxAmount();
var taxableAmt = currLine.getTaxableAmount();
...
}
}
...
}
}
getTaxAmount()
Function Declaration |
|
Type |
Object method |
Description |
Returns a string that represents the amount of tax charged on a standard GL line. This method only returns a value other than 0 if the standard line is a credit to a tax account. For example, if a standard line on a taxable transaction contains a credit value of 10.00 for an account of type Other Current Liability, this method returns -10. Use this method with getTaxableAmount(), getTaxItemId(), and getTaxType() to get the tax information for a standard GL impact line. |
Returns |
string |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
// check tax
if (currLine.getTaxItemId() != -7) // taxable transaction
{
var taxType = currLine.getTaxType();
if (taxType == "US_ST")
{
// process state taxes
var taxAmt = currLine.getTaxAmount();
var taxableAmt = currLine.getTaxableAmount();
...
}
}
...
}
}
getTaxItemId()
Function Declaration |
|
Type |
Object method |
Description |
Returns the internal NetSuite ID of the tax code for a standard GL line. Returns null if the line was not subject to tax or if the line does not credit a tax account with a tax liability. You can use this ID to define plug-in implementation functionality based on the tax code. For example, a tax code of -7 indicates the line was not subject to tax. You can view all tax codes in NetSuite at Setup > Accounting > Tax Codes. You can use helper functions in a utility file to avoid adding the internal NetSuite IDs into the plug-in implementation logic. See Utility Files for a Custom GL Lines Plug-In Implementation. Use this method with getTaxableAmount(), getTaxAmount(), and getTaxType() to get the tax information for a standard GL impact line. |
Returns |
int |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
// check tax
if (currLine.getTaxItemId() != -7) // taxable transaction
{
var taxType = currLine.getTaxType();
if (taxType == "US_ST")
{
// process state taxes
var taxAmt = currLine.getTaxAmount();
var taxableAmt = currLine.getTaxableAmount();
...
}
}
...
}
}
getTaxType()
Function Declaration |
|
Type |
Object method |
Description |
Returns the tax type for a standard GL line that was subject to tax. Returns null if the standard line was not subject to tax. You can use this ID to define plug-in implementation functionality based on the tax type. You can view all tax types in NetSuite at Setup > Accounting > Tax Types. Use this method with getTaxableAmount(), getTaxAmount(), and getTaxItemId() to get the tax information for a standard GL impact line. |
Returns |
string |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
// check tax
if (currLine.getTaxItemId() != -7) // taxable transaction
{
var taxType = currLine.getTaxType();
if (taxType == "US_ST")
{
// process state taxes
var taxAmt = currLine.getTaxAmount();
var taxableAmt = currLine.getTaxableAmount();
...
}
}
...
}
}
isPosting()
Function Declaration |
|
Type |
Object method |
Description |
Returns NetSuite transactions can be posting, non-posting, or posting with approval. For example, journal entries do not post without approval. For more information, see General Ledger Impact of Transactions. |
Returns |
boolean |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
// find all posting lines
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
if (currLine.isPosting())
{
// process standard line here
}
}
...
}
isTaxable()
Function Declaration |
|
Type |
Object method |
Description |
Returns |
Returns |
boolean |
Input Parameters |
None. |
Parent object |
Example
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{
...
// find all taxable lines
for (var i = 0; i < standardLines.getCount(); i++)
{
var currLine = standardLines.getLine(i);
if (currLine.isTaxable())
{
// process tax here
}
}
...
}