When loading existing criteria from saved search using getFilterExpression unexpected error is thrown if isempty or isnotempty operators are used as criteria and are passed as parameter to function setFilterExpression.
This is documented in Defect 244249.
Steps to reproduce:
- Lists > Relationships > Vendor > Search
ID: customsearch_test
Criteria: Comments is empty
OR
Comments is not empty
Save - Log into debugger
- Run script attached below
Actual Result:
Unexpected error is thrown.
Expected result:
No error is shown; whole filter expression is cloned to new search.
Script:
var search = nlapiLoadSearch('vendor', 'customsearch_test');var filterExpr = search.getFilterExpression();var search2 = nlapiCreateSearch('vendor');search2.setFilterExpression(filterExpr);var debugger_placeholder = 0;Solution:
Construct filter expression manually with third element "null" in array as following:
var filterExpr = [ ["notes", "isempty", null], "OR", ["notes", "isnotempty", null] ];
No comments:
Post a Comment