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 to define plug-in implementation functionality based on the entity ID, load the record for the entity with See also Record.
Important:
Limit using these APIs to improve the performance of your plug-in implementation. Searching for a record is faster than loading it. To implement functionality based on the entity ID, you can use helper functions to avoid adding the internal NetSuite ID in 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. For most transaction types, the summary line for the GL impact has an ID of 0, but some transactions, like journals, don't have a summary line. You can use the summary information to define plug-in implementation functionality based on the summary line values.
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 their internal IDs in NetSuite at Setup > Company > Subsidiaries. You can use this ID to define plug-in implementation functionality based on the subsidiary ID, load the record for the subsidiary with The type parameter for a subsidiary is
Important:
Limit using these APIs to improve the performance of your plug-in implementation. Searching for a record is faster than loading it. 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 showing the amount of a standard GL line that was taxed. Returns 0 if the line wasn't taxed. 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 so you don't have to add internal NetSuite IDs in 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 showing 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 has 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 wasn't taxed or if the line doesn't 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 means the line wasn't taxed. You can view all tax codes in NetSuite at Setup > Accounting > Tax Codes. You can use helper functions in a utility file so you don't have to add internal NetSuite IDs in 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 taxed. Returns null if the standard line wasn't taxed. 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 don't 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
}
}
...
}