How to create a saved search in the Console

Initially we have to get the exported code of the search that we have to create new search.

Then open the Netsuite account and a record that which type of search is to be created. For example of we have create a sales order search then open a sales order and take the console from the sales order record.

Then copy the code and give a name.

Then press enter button. The search will be created.

For example,

For getting the exported search, open the search in edit mode and click the export as script button.

Copy the codes by clicking on copy button

Then we have to create a sample file using this code which is to be pasted to the console.

For example

require(['N/search'],
(search) => {
  var customerSearchObj = search.create({
                    type: "invoice",
title:'NAME OF THE SEARCH THAT WE HAVE TO CRAETE',
                    filters:
                        [                            
                            ["transaction.type", "anyof", "CustInvc"],
                            "AND",
                            ["transaction.status", "anyof", "CustInvc:A"],
                            "AND",
                            ["transaction.mainline", "is", "T"],
                           
                        ],
                    columns:
                        [
                            search.createColumn({name: "altname", label: "Name"}),
                            search.createColumn({
                                name: "tranid",
                                join: "transaction",
                                label: "Document Number"
                            }),   
                           
                        ]
                }).save();
});

The search codes including the filters and columns are copied from the export script.

Paste the codes in console and then press enter to create the search

Leave a comment

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