Hi All, I am having some issue with the MR script....
# suitescript
s
Hi All, I am having some issue with the MR script. I am trying to save a saved search criteria but it's not getting saved. Can anyone help me with it?
b
what does the code look like
generally, if you can run the search, you can save it
s
No I am having issue with saving a date time criteria?
b
you probably want to explain what you are trying to do
and where your problem is
s
I am trying to load the saved search. Get the default filter and update an existing date time filter of the saved search and saving it. But unfortunately the criteria is not getting saved.
b
how are you getting and modifying the criteria
s
Var d= search.filters Var newFilter=search.createFilter(name,operator,value) d.push(newFilter). Saving the saved search
b
getting and modifying the criteria looks fine
where is the setting of the criteria
s
Sorry, I didn't get you
b
where do you your new criteria on the search
s
I am just modifying the existing one
b
search.filters uses a getter function to return a copy of the filters
you need to do search.filters = d
or something similar to set the filter
s
I tried that as well but no luck.
b
you can try using the current form of createFilter, which uses an object as a parameter
but you should be overwriting the search if you do search.save somewhere
s
I will have a closer look at my code.
Thanks for your great help.