How to fetch saved search data with the title

Recently, I worked on a single-page application(SPA) for rendering saved search data from NetSuite. The client wanted to reuse the application for multiple saved searches. So, the app was designed with a search internal ID as a URL parameter and the data was fetched using the ID. However, the client also wanted to show the search title to better data readability. This is the code I used in Suitescript to fetch the search title:

if (action == 'get-dashboard' && params.dashboard_id) {
               // Load search title
                var searchResults = search.lookupFields({
                    type: search.Type.SAVED_SEARCH,
                    id: params.dashboard_id,
                    columns: ['title']
                });
                response.title = searchResults['title'];
                // Load search data
                .
                .
                response.success = true;
            }

Leave a comment

Your email address will not be published. Required fields are marked *