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 { return { id: row.getValue('internalid'), date: row.getValue('trandate'), account: row.getText('account'), debit: parseFloat(row.getValue('debitamount')), credit: parseFloat(row.getValue('creditamount')) } }); }

Generate More

Questions about programming?Chat with your personal AI assistant