I have a search with 20 million results. is it pos...
# suitescript
a
I have a search with 20 million results. is it possible to run this and show the result with SS2?
j
Not sure if your problem is with the result size or getting a search to display. If it is the latter, then look into
Copy code
redirect.toSearchResult
from the N/redirect module.
a
thanks, but my script is suitelet and it seems it doesn't support suitelet
d
redirect.toTaskLink(options)
please check this, it will help you out definitely
API detail
task Id
Just create a UI Saved search check view pagesource, search for nlpopup and get the ID
This API is supported in Suitelet
a
there are 2 issues
1- I don't want to create a UI saved search
2- I don't want to leave suitelet page
because this is a suitelet page with 5 different searches
basically I want to create same ui result page in suitescript
and I don't want this bit. just everything under this section.
that redirect.toSearchResult is great but the issue is I don't want to redirect the page and I don't want to see that part which is in the picture.
a
You can use do{}while and getRange to get 20 million results.
s
That search is almost guaranteed to time out if you try to run that in a suitelet
p
Definitely seems like the wrong way to be going about things
Rubbish user experience for a start
b
im with team redirect, though i would recommend instead putting the page in an iframe and set ifrmcntnr=T in the iframe url
your ui will match more what you want
if you really want to put in the extra effort to make it look how you want, then you will need to struggle a bit with creating a form with sublist containing your search results
keep in mind that you will have no choice but to implement pagination, you arent getting 20 million search results
at best you can get 199000 due to governance issues. There is no nice way to display it so you need to get 1 page of search results at a time and then display it
s
Yeah doesnt sound like a task I would want to try to accomplish
a
@battk how can I use pagination?
b
netsuite's way is to fill up your sublist with however many results you want, then have a field to choose which page you want
then click a button to get that page
a
how can I redirect just that iframe in the suitelet page
b
you wouldnt be using an ifram if you are building your own form
a
how can I add that field
to choose which page
and a button to click
a
seems a bit complicated, is there any example for that?
b
it is extra complicated.
you have chosen to fight the easy solution, you get the hard one
a
what's the job of refresh button
and that field
b
refresh button will make a new request to the suitelet
suitelet returns a new form with a sublist containing new values
a
like a submit button
is it a post request?
b
i think so
job of the field is to choose which page to return
a
and every time I have to run the search
b
correct
a
can I add a button to a search result page?
b
netsuite's search pages don't officially support customization
a
any unofficial way?
b
you can do xss since result columns arent escaped
a
xss?
b
its a security vulnerability in search result columns
a
you mean inject html code to a clumn?
b
yes
a
another issue is when I create a saved search I have a link for records but when you create a search with suitescript there is not link even no record id and record type to generate link
system note search
b
generate the links yourself
a
how?
there is no type or id
b
there are columns for record type and record id
a
no
when you add them through ss2
you will get an error
invalid column
d
what are you doing to add the columns?
a
list.addColumn
b
that looks like a List instead of a Form
a
yes, is there any difference for generating a link or anything else?
b
for lists you use ListColumn.setURL
a
I know that but the issue is
record links
so in the search result there is a list of records and changes related to those records
if you create ui search those record are hyperlink
but with saved search there is no link
or id and type to generate link
b
correct, you will have to use the recordtype and recordid columns to generate the link
will probably be uglier since you would have to map the names used in the ui to record type ids used in scripts
a
are you sure
because all the record types are systemnote
b
what code are you using to get the record type?
a
recordtype column
b
are you doing result.recordType or result.getValue({name: 'recordtype'})
a
will probably be uglier since you would have to map the names used in the ui to record type ids used in scripts? could you please explain mpore
recordType
b
system notes have a column named recordtype
distinct from the recordType found on search results
a
thanks
what was that mapping thing?
b
take a look at the values from the record type column in the ui
a
thanks
@battk /app/common/media/mediaitem.nl?id=131761 the recordtype column for this links is empty and those are cause the problem
b
probably doomed on the link then, unless its the only one missing recordtype
i doubt you will be able to guess it from the name of the record column