Generation

generate functionWed, 14 Dec 2022

Use SuiteScript 2.1 to search for journal records within the current year

function findJournalEntries(year) { var search = nlapiSearchRecord('journalentry', null, [ ['type', 'anyof', 'Journal'], 'AND', ['year', 'on', year] ], [ new nlobjSearchColumn('internalid'), new nlobjSearchColumn('trandate'), new nlobjSearchColumn('account'), new nlobjSearchColumn('debitamount'), new nlobjSearchColumn('creditamount') ]); return search.map(function(row) { return { id: row.getValue('internalid'), date: row.getValue('trandate'), account: row.getText('account'), debit: parseFloat(row.getValue('debitamount')), credit: parseFloat(row.getValue('creditamount')) } }); }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant