Nour
09/08/2026, 12:07 PMCeligo AI
09/08/2026, 12:07 PMAI generated answer (using internal Slack threads):To create a saved search in SuiteScript that returns the items, each line number, each quantity, and its inventory details given the return authorization id, you can use the
N/search module. Here's a basic example of how you might do this:
javascript
var search = require('N/search');
function createSearch(returnAuthId) {
var returnAuthSearch = search.create({
type: search.Type.RETURN_AUTHORIZATION,
filters: [
['internalid', 'anyof', returnAuthId]
],
columns: [
'line',
'item',
'quantity',
'inventorydetail'
]
});
returnAuthSearch.run().each(function(result) {
log.debug({
title: 'Line: ' + result.getValue('line') + ', Item: ' + result.getText('item') + ', Quantity: ' + result.getValue('quantity'),
details: 'Inventory Detail: ' + result.getValue('inventorydetail')
});
return true;
});
}
This script creates a saved search on the Return Authorization record type, filtered by the provided return authorization id. It then logs each line number, item, quantity, and inventory detail.
Please note that this is a basic example and might need to be adjusted based on your specific requirements and the actual structure of your data.
******
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
09/08/2026, 12:07 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831237793
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82043457
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820129395
Celigo AI
09/08/2026, 12:07 PM