``` var searchObject = search.load({ ...
# suitescript
j
Copy code
var searchObject = search.load({
                title: 'search title ',
                id: searchId,
            });
            searchObject.filters = filters;
            myPagedData.pageRanges.forEach(function (pageRange) {
                var myPage = myPagedData.fetch({index: pageRange.index});
                myPage.data.forEach(function (result) {
                    
                });
            });
b
This isnt using filterExpression
j
I've tried
Copy code
[
                    [
                        [['custrecord_vm_fl_end_date', 'onorafter', request.timeline_start], 'AND', ['custrecord_vm_fl_end_date', 'onorbefore', request.timeline_end]], 'OR',
                        [['custrecord_vm_fl_start_date', 'onorafter', request.timeline_start], 'AND', ['custrecord_vm_fl_start_date', 'onorbefore', request.timeline_end]], 'OR',
                        [['custrecord_vm_fl_start_date', 'onorbefore', request.timeline_start], 'AND', ['custrecord_vm_fl_end_date', 'onorafter', request.timeline_end]]
                    ]
                ]
and
Copy code
[{
                    name: "custrecord_vm_fl_end_date",
                    operator: "onorafter",
                    values: [request.timeline_start],
                    leftparens: 2,
                    rightparens: 0,
                    isor: false
                },{
                    name: "custrecord_vm_fl_end_date",
                    operator: "onorbefore",
                    values: [request.timeline_end],
                    rightparens: 1,
                    leftparens: 0,
                    isor: true
                },{
                    name: "custrecord_vm_fl_start_date",
                    operator: "onorafter",
                    values: [request.timeline_start],
                    rightparens: 0,
                    leftparens: 1
                },{
                    name: "custrecord_vm_fl_start_date",
                    operator: "onorbefore",
                    values: [request.timeline_end],
                    rightparens: 1,
                    leftparens: 0,
                    isor: true
                },{
                    name: "custrecord_vm_fl_start_date",
                    operator: "onorbefore",
                    values: [request.timeline_start],
                    rightparens: 0,
                    leftparens: 1
                },{
                    name: "custrecord_vm_fl_end_date",
                    operator: "onorafter",
                    values: [request.timeline_end],
                    rightparens: 2,
                    leftparens: 0
                }]
b
Did you set searchObject.filterExpression
j
nope, setting searchObject.filters, which works if you create the search in the code instead of loading. Should it be passed to filterExpression instead?
b
filters are for filter objects
filterExpression is for filter expressions
j
ahh, weird it would work for created searches. Thanks for the tip. I'll give that a shot
j
👍 thanks @battk
that worked by the way, thanks!
b
glad it worked out