How to resolve SuiteScript Error SSS_INVALID_SRCH_OPERATOR

If an nlobjSearchFilter contains an invalid operator, or is not in proper syntax: {1}, an error is thrown: SSS_INVALID_SRCH_OPERATOR 

The error may be thrown by any of the following scenarios:

The filter name is not officially supported, i.e., the filter is not officially documented in the SuiteScript Records Browser under the record type being searched.

// ERROR: The filter ‘name’ is not an official search filter for the ‘salesrecord’ record type 

// nlobjSearchFilter example 

var f = new nlobjSearchFilter(‘name’, null, ‘startswith’, ‘Item #1’); 

// filter expression example 

var f = [‘name’, ‘startswith’, ‘Item #1’]; 

var s = nlapiSearchRecord(‘salesorder’, null, f);

The operator used in the filter does not match the field type of the filter. 

//ERROR: The operator ‘within’ is not valid for Text-type fieldset 

//nlobjSearchFilter example 

var f = new nlobjSearchFilter(‘name’, null, ‘within’, ‘Item #1’); 

//filter expression example 

var f = [‘entity’, ‘within’, ‘Item #1’]; 

var s = nlapiSearchRecord(‘salesorder’, null, f);

To help avoid this error, follow these steps:

1.Open the SuiteScript Records Browser.

2.Navigate to the record type being searched.

3.Locate the Search Filters table and verify whether the filter is listed.

Check the list of Search Operators within the Help Guide to see whether the search operator used within the filter matches the type of the specified field.

Leave a comment

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