HOW TO CREATE A SEARCH IN SUITESCRIPT 2.0?

To create a search within any 2.0 script, we need to use search module and using its object create filters and columns and then run it. The following code can be used to create a search in 2.0


define(['N/record', 'N/search'],

function(record, search) {
 
 

    function execute(scriptContext) {

var customersearch = search.create({
type: "customer",
filters: [
       
                       search.createFilter(
                     
                     
                       {
                    name: 'isinactive',
                    operator: 'is',
                      values:['F']
                           }),
                     
                 
],
columns: [
search.createColumn({
name: "internalid",
sort: search.Sort.ASC
}),

"email",

]
});

var customersearchres = customersearch.run().getRange(0, 1000);


}

 return {
        execute: execute
    };
 
});

 contact us at:
Email : info@smilingcoders.com


Comments

Popular posts from this blog

Work Around the 1000 Row Limit Returned by Saved Searches in Netsuite

Understand Core Technology behind SuiteScript 2.0

HOW TO SET SUBLIST SUB RECORD VALUES IN SUITE SCRIPT 1.0 AND 2.0