Nour Khaled
02/13/2025, 10:19 AMCeligo AI
02/13/2025, 10:19 AMAI generated answer (using internal Slack threads):The function you provided is a SuiteScript search that is designed to return a set of transactions based on the specified filters and columns. The filters are set to return transactions of type CashRfnd, CashSale, CustCred, CustInvc that are not mainline, taxline, shipping, cogs and have a specific status. The columns are set to return the internal ID, item, ATC Item Brand, Display Name, and several calculated values based on the transaction type and date. The result you provided is a single result from this search, represented as a JSON object. If you want to return each of the results from the search, you would need to iterate over the
searchResults
array and process each result individually. Here's a simple example of how you might do that:
javascript
searchResults.forEach(function(result) {
var values = result.values;
var internalId = values['GROUP(item.internalid)'][0].value;
var item = values['GROUP(item)'][0].value;
var atcItemBrand = values['GROUP(item.custitem_atc_item_brand)'][0].value;
var displayName = values['GROUP(item.displayname)'];
var formulaCurrency = values['SUM(formulacurrency)'];
var formulaCurrency1 = values['SUM(formulacurrency)_1'];
var formulaCurrency2 = values['SUM(formulacurrency)_2'];
var formulaCurrency3 = values['SUM(formulacurrency)_3'];
var formulaCurrency4 = values['SUM(formulacurrency)_4'];
// Now you can do something with these values...
});
This code will loop over each result in the searchResults
array, extract the values from each result, and then do something with those values. You would replace the comment with whatever you want to do with the values.
******
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
02/13/2025, 10:19 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.87130028
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.869320631
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.867789626
Celigo AI
02/13/2025, 10:19 AM