acuestajohnmark
05/08/2025, 7:55 PMCeligo AI
05/08/2025, 7:55 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the Custom GL Lines plugin is based on SuiteScript 1.0 and it's not clear if it can be converted to SuiteScript 2.0. Here is a sample code snippet for a Custom GL Plugin Script:
javascript
function customizeGlImpact(transactionRecord, standardLines, customLines, book) {
var countStandard = standardLines.getCount();
nlapiLogExecution("DEBUG", "Line Count", standardLines.getCount());
var currLine = standardLines.getLine(0);
var entityId = currLine.getEntityId();
var tranSubsidiary = transactionRecord.getFieldValue('subsidiary');
var recordType = transactionRecord.getRecordType();
nlapiLogExecution("DEBUG", "Subsidiary", tranSubsidiary);
var newLine = customLines.addNewLine();
newLine.setDebitAmount(45.21);
newLine.setAccountId(125);
newLine.setEntityId(entityId);
newLine.setMemo("Test Debit Amount");
var newLine = customLines.addNewLine();
newLine.setCreditAmount(45.21);
newLine.setAccountId(568);
newLine.setEntityId(entityId);
newLine.setMemo("Test Credit Amount");
}
This function customizes the GL impact of a transaction. It first gets the count of standard lines and logs it. Then it gets the first standard line and extracts the entity ID from it. It also gets the subsidiary and record type from the transaction record. After that, it adds two new custom lines to the GL impact, one for debit and one for credit, and sets their respective amounts, account IDs, entity IDs, and memos.
Remember to ensure that all necessary fields are set correctly, including the subsidiary field, otherwise the script may not run.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/08/2025, 7:55 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.809901834
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.807103515
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805428863
Celigo AI
05/08/2025, 7:55 PM