RE: SSS_MISSING_REQD_ARGUMENT error
I have below query: and I deployed it in my Netsuite. But I have below error message which I don’t know how to fix it.
/**
* @NApiVersion 2.1
* @NScriptType RESTlet
*/
define([‘N/scriptTypes/restlet’, ‘N/query’],
function(restlet, query) {
// RESTlet entry point
const get = function (requestParams) {
// Create Employee query
const qObj = query.create({
type: query.Type.EMPLOYEE
});
// Set query condition for the Supervisor field on the employee record, it should not be empty
qObj.condition = qObj.createCondition({
fieldId: ‘supervisor’,
operator: query.Operator.EMPTY_NOT
});
// Add supervisor value in the query results
qObj.columns = [qObj.createColumn({
fieldId: ‘supervisor’
})]
const returnArray = [];
// Retrieve the results
const results = qObj.run().results;
for (var i = results.length – 1; i >= 0; i–) {
const obj = results[i];
returnArray.push(obj.values[0]);
}
// Create a RESTlet custom response to set the Content-Type header to JSON object
const response = restlet.createResponse({
content: JSON.stringify(returnArray),
contentType: ‘application/json’
});
log.debug(‘response’, JSON.stringify(response))
return response;
}
return { get };
});
`query.create({type: query.Type.EMPLOYEE});` that code snippet works for me. I’d try adding a NEW log message right before you call query.create() to validate your script in NetSuite is actually being updated – maybe an old version of the script is still being run in NetSuite.