{"type":"error.SuiteScriptError","name":"UNABLE_TO...
# ask-stanley-ai
n
{"type":"error.SuiteScriptError","name":"UNABLE_TO_DETERMINE_RECORD_TYPE_FOR_SAVED_SEARCH_ID_1","message":"Unable to determine record type for saved search id 163","id":"","stack":["Error\n at Object.onRequest (/SuiteScripts/_Suitelet 2x Item Inventory Lot Report AlJomaih.js7235)"],"cause":{"type":"internal error","code":"UNABLE_TO_DETERMINE_RECORD_TYPE_FOR_SAVED_SEARCH_ID_1","details":"Unable to determine record type for saved search id 163","userEvent":null,"stackTrace":["Error\n at Object.onRequest (/SuiteScripts/_Suitelet 2x Item Inventory Lot Report AlJomaih.js7235)"],"notifyOff":false},"notifyOff":false,"userFacing":true}
c
AI generated answer (using internal Slack threads):
The error
UNABLE_TO_DETERMINE_RECORD_TYPE_FOR_SAVED_SEARCH_ID_1
typically occurs when you are trying to load a saved search in SuiteScript without specifying the type of the search, especially when the search is on a custom record. To resolve this issue, you need to specify the type of the search in the
search.load
function. Here is an example of how to do it:
Copy code
javascript
var searchObj = search.load({id: request.searchID, type: request.searchType});
In the request payload you send to the RESTlet, you should add in the search type parameter. The search type can be found in the NetSuite UI, or by using the
nlapiGetFieldValue('searchtype')
function in the console of the saved search. However, please note that SuiteScript does not support reports. If your saved search type is a report, you might need to rebuild it as a saved search or an analytics workbook. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.914698243
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.912552536
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.900261164
Please provide your feedback on this answer.