customizeGlImpact(context)

Important:

The customizeGlImpact(context) function is used exclusively with SuiteScript 2.x, and is not compatible with SuiteScript 1.0

standardLines

Type

StandardLines (read-only)

customLines

Type

CustomLines (read-only)

transactionRecord

Type

ReadOnlyTransactionRecord (read-only)

book

Type

AccountingBook (read-only)

Example

          /**
 * @NApiVersion 2.x
 * @NScriptType customglplugin
 */
define(function() {
    function customizeGlImpact(context) {
        var customLines = context.customLines;
        var amount = '100.00';
     
        var memo = context.transactionRecord.getValue({fieldId : 'memo'});
        var firstAccount = context.standardLines.getLine({index: 0}).accountId;
        var secondAccount = context.standardLines.getLine({index: 1}).accountId;
        var bookId = context.book.id;
 
        var firstLine = customLines.addNewLine();
        firstLine.accountId = firstAccount;
        firstLine.creditAmount = amount;
        firstLine.memo = memo + ' for book ' + bookId;
        firstLine.isBookSpecific = false;
     
        var secondLine = customLines.addNewLine();
        secondLine.accountId = secondAccount;
        secondLine.debitAmount = amount;
        secondLine.memo = memo + ' for book ' + bookId;
        secondLine.isBookSpecific = false;
    }
 
    return {  
        customizeGlImpact: customizeGlImpact,
    }
}); 

        

Related Topics

General Notices