Resolve Error: “SSS_INVALID_SRCH_OPERATOR” on RESTlet

Scenario:

User has a RESTlet script that is getting the value of the dynamic filter from the request parameter. However, user is getting an error: “SSS_INVALID_SRCH_OPERATOR”. When the script operator parameter value is hard-coded, error is not reproducible.

Solution:

The reason why the error: “SSS_INVALID_SRCH_OPERATOR” is encountered when using script parameters as search operator is because the value coming from the request parameter is search.Operator.IS. Below are the steps to resolve this:

Get operator value from parameter

Convert the value to lower case using toLowerCase()

Replace “search.operator.” to “”

Create the filter using the sample code below:

function doGet(requestParams) {

var y = requestParams.operator1;

var y2 = y.toLowerCase();

var y3 = y2.replace(“search.operator.”, ”);

var dynFilter = search.createFilter({ name: requestParams.field1, operator: y3, values: requestParams.value1a });

}

Leave a comment

Your email address will not be published. Required fields are marked *