Hello, I have a RESTLet that loads a search based ...
# suitescript
k
Hello, I have a RESTLet that loads a search based on the params passed, and tries to send all the data of the search back. I tried passing multiple search ids to the RESTlet but I keep on getting the following error on different fields (custom as well as native). Is this something that needs to be fixed on the script or the field setup side?
Copy code
"An nlobjSearchFilter contains an invalid operator, or is not in proper syntax: FIELD_ID."
b
sounds like you are constructing a filter incorrectly
share your code related to filters
k
Here it is:
Copy code
function doGet(requestParams) {

        var results = [];
        var slice = [];
        var i = 0;

        var mySearch = search.load({
            id: requestParams.searchid
        });

        var resultSet = mySearch.run();

        do {
            slice = resultSet.getRange({ start: i, end: i + 999 });
            resultSet.forEach(function(row) {
                var resultObj = {};
                row.columns.forEach(function(column) {
                    resultObj[column.name] = row.getValue(column);
                    });
                results.push(resultObj);
                i++;
            });
        } while (slice.length >= 1000);

        return JSON.stringify(results);
    }
I just noticed that it seems to work for some search though
b
I wouldn't expect your code to actually return all the search results, your counting doesnt look right
but it doesnt look like you modify any filters
so make sure that whatever user/role combination has permission to run that search with the filters defined on the search
k
Got it! It does look like the Integration Role does not have right permissions. Thank you!