What can cause this error on a map/reduce script? ...
# ask-stanley-ai
r
What can cause this error on a map/reduce script? {"type":"error.SuiteScriptError","name":"SSS_MISSING_REQD_ARGUMENT","message":"search.load: Missing a required argument: id","id":null,"stack":["createError(N/error)","pagedLineResults(/SuiteScripts/_work/code/srvc/order_to_cash_return_to_credit/erp/orders/rules.js:222)","loadProdRulesSearch(/SuiteScripts/_work/code/srvc/order_to_cash_return_to_credit/erp/orders/rules.js:292)","summarize(/SuiteScripts/_work/code/srvc/order_to_cash_return_to_credit/erp/orders/rules.js:108)","createError(N/error)"],"cause":{"name":"SSS_MISSING_REQD_ARGUMENT","message":"search.load: Missing a required argument: id"},"notifyOff":false,"userFacing":true}
c
AI generated answer (using internal Slack threads):
The error
SSS_MISSING_REQD_ARGUMENT
with the message
search.load: Missing a required argument: id
is caused when the
search.load
function is called without providing the required
id
argument. The
id
argument is necessary to specify the ID of the saved search to load. In the context of a Map/Reduce script, this error could occur if the
getInputData
function is trying to load a saved search without providing its ID. Here is an example of how to correctly use the
search.load
function:
Copy code
javascript
var mySearch = search.load({
    id: 'customsearch_my_saved_search'
});
In this example,
customsearch_my_saved_search
is the ID of the saved search to load. If the ID is not provided or is incorrect, the
SSS_MISSING_REQD_ARGUMENT
error will be thrown. ****** 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.863952637
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.862976134
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859313846
Please provide your feedback on this answer.