Jeff Greene
12/23/2025, 5:04 AMCeligo AI
12/23/2025, 5:04 AMAI generated answer (using internal Slack threads):To get a period's trial balance by multiple dimensions (e.g. account and department, or department and vendor) using NetSuite APIs, you can create a saved search in NetSuite and then use SuiteScript to pull that saved search and read the data. Here are the steps: 1. Create a saved search in NetSuite: - Go to Reports > Saved Searches > All Saved Searches > New. - Select the record type you want to search. In this case, you might want to select 'Transactions'. - Define your criteria. You can select the 'Account' and 'Department' or 'Department' and 'Vendor' as your criteria. - Define your results. You might want to include 'Date', 'Account', 'Debit', 'Credit', 'YTD Debit', 'YTD Credit' in your results. - Save your search. 2. Use SuiteScript to pull the saved search and read the data: - You can use the
N/search module in SuiteScript to load and run the saved search.
- Here is a sample code snippet:
javascript
var search = require('N/search');
// Load the saved search
var mySearch = search.load({
id: 'customsearch_my_saved_search'
});
// Run the search and process the results
mySearch.run().each(function(result) {
// Process each result
var account = result.getValue({
name: 'account'
});
var debit = result.getValue({
name: 'debit'
});
var credit = result.getValue({
name: 'credit'
});
var ytdDebit = result.getValue({
name: 'ytddebit'
});
var ytdCredit = result.getValue({
name: 'ytdcredit'
});
// Log the values
log.debug('Account: ' + account + ', Debit: ' + debit + ', Credit: ' + credit + ', YTD Debit: ' + ytdDebit + ', YTD Credit: ' + ytdCredit);
return true; // Continue to the next result
});
Remember to replace 'customsearch_my_saved_search' with the actual ID of your saved search.
******
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
12/23/2025, 5:04 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839233458
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837158263
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833313
Celigo AI
12/23/2025, 5:04 AMNagendra Ponaganti
02/20/2026, 10:46 AM