{"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 646","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 646","userEvent":null,"stackTrace":["Error\n at Object.onRequest (/SuiteScripts/_Suitelet 2x Item Inventory Lot Report AlJomaih.js7235)"],"notifyOff":false},"notifyOff":false,"userFacing":true} i'm trying to load the saved search in a suitelet and this keeps poppin up. the saved search type is inventory balance and this is the script code var mySearch = search.load({ id: 646 });
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 and NetSuite is unable to determine the type of the saved search. This is common when dealing with custom record types. To resolve this issue, you need to specify the type of the saved search when loading it. The
search.load
function accepts a
type
parameter that you can use to specify the type of the saved search. Here is an example:
Copy code
javascript
var mySearch = search.load({
    id: 'customsearch_my_custom_search',
    type: 'customrecord_my_custom_record'
});
In the above example,
customsearch_my_custom_search
is the ID of the saved search and
customrecord_my_custom_record
is the type of the saved search. If you are unsure of the type of the saved search, you can find it by going to Customization > Lists, Records, & Fields > Record Types in NetSuite. The ID listed there is what you want to use as the
type
parameter. Please note that not all types of saved searches are supported in SuiteScript. For example, saved searches of type 'Report' are not supported. In such cases, you may need to recreate the search as a different type or use an alternative method to retrieve the 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. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.904358804
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.896434128
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.892605722
Please provide your feedback on this answer.