Search code examples
netsuitesuitescriptsuitescript2.0saved-searches

Get Drill Down Values for Summary Search Using SuiteScript


I'm trying to access the drill down values for a summary search using SuiteScript.

For example I have a transaction search that is set to group on the customer's name. In the UI when I click the name column hyperlink in the summary search it takes me to the filtered results of that specific customer's transactions. I would like to access these filtered values in my script.

Is there a way to do this other than create a new search for each customer in the summary search "each" loop (which has governance issues)?

My backup solution is to not use a summary search and create my own summarized objects in my script but I like to use native NetSuite functionality wherever possible.

I'm guessing it's not possible because I can find no documentation on it and the search in the UI seems to be creating a new search on the fly for the drill down. But I thought I'd ask it here to exhaust all my options and to help anyone in the future that might be looking for this answer.


Solution

  • You cannot drill down on search results using a script.

    There are a couple of ways to get where you want to be though

    Simplest might be:

    • Do the work in a map/reduce script.
    • remove the summary fields from the search
    • load the search in the getInput() and return the search object. Netsuite will then run the search for you.
    • in the map() group the results by customer
    • in the reduce() use the grouped results like they were the drill down details