RE: GL Custom Lines

Dear Forum Member

Happy new year, wish all the best for 2021

 

Please I need help to change the account id with GL Custom lineĀ  I’m using the following script

 

function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{

var currLine = standardLines.getLine(0);

currLine.setCreditAmount(transactionRecord.getFieldValue(‘total’));
currLine.setAccountId(431);
currLine.setMemo(“Iem Receipt”);

var currLine = standardLines.getLine(0);
currLine.setDebitAmount(transactionRecord.getFieldValue(‘total’));
currLine.setAccountId(432);
currLine.setMemo(“Item Receipt”);
}

 

I get the following error message

TypeError: Cannot find function setCreditAmount in object com.netledger.app.accounting.transactions.plugin.CustomGlLinesPluginJavaImpl$StandardLineImpl@254ba255. (INVOCATION_WRAPPER#6)

Thanks Dears to help

Best Regards

Farouk

fharrache2003 Rookie Asked on January 1, 2021 in SuiteScript.
Add Comment
3 Answers

thank you for your help

I’ve changed the script as below but still getting the same error message

Regards

function customizeGlImpact(transactionRecord, standardLines, customLines, book)
{

for (var i = 0; i < standardLines.getCount(); i++)
{ var currLine = standardLines.getLine(i);
}

currLine.setCreditAmount(standardLines.getLine().getCreditAmount());
currLine.setAccountId(431);
currLine.setMemo(“Achat”);
currLine.setDebitAmount(standardLines.getLine().getDebitAmount());
currLine.setAccountId(432);
currLine.setMemo(“Achat”);

}

Rookie Answered on January 2, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.