`var updatedProducts= search.create({`            ...
# suitescript
a
var updatedProducts= search.create({
                
type: search.Type.ITEM,
                
filters: [
                    
['custitem_f3mg_magento_stores', <http://search.Operator.IS|search.Operator.IS>, '2'],
                    
'and',
                    
[
                        
[
                        
['type', search.Operator.ANYOF, 'InvtPart'],
                        
'and',
                        
['lastquantityavailablechange', search.Operator.ONORAFTER, '04/01/2020 12:00 am']
                        
],
                        
'or',
                        
[
                            
['type', search.Operator.ANYOF, 'Kit'],
                            
'and',
                            
['lastquantityavailablechange','memberitem',search.Operator.ONORAFTER, '04/01/2020 12:00 am']
                        
],
                        
'or',
                        
[
                            
['type', search.Operator.ANYOF, ["InvtPart","Kit"]],
                            
'and',
                            
['lastquantityavailablechange', search.Operator.ONORAFTER, '04/01/2020 12:00 am']
                        
]
                    
]
                
]
            
});
ERROR:
{"type":"error.SuiteScriptError","name":"SSS_INVALID_SRCH_OPERATOR","message":"An nlobjSearchFilter contains an invalid operator, or is not in proper syntax: memberitem.","stack":["createError(N/error)","execute()","createError(N/error)"],"cause":{"name":"SSS_INVALID_SRCH_OPERATOR","message":"An nlobjSearchFilter contains an invalid operator, or is not in proper syntax: memberitem."},"id":"","notifyOff":false,"userFacing":true}
Trying to create a saved search with conditional expression but following error encountered.
b
create the search in the ui first
then load the saved search via script and then log the filter expression
then copy the filter expression for your code
👍 2
d
create saved search in UI and use this extension
a
It worked .. Thanks @D17339 @battk