The Smiling Coders

Netsuite Implementation, Support, Training and Integration

HOW TO CREATE A SEARCH IN SUITESCRIPT 2.0?

HOW TO CREATE A SEARCH IN SUITESCRIPT 2.0?

Category : 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 SuiteScript 2.0define([‘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
};

});

Feel free to reach out TheSmilingCoders for proper netsuite implementationnetsuite consultation , netsuite customization, netsuite Support,netsuite Trainingcontact us at:

Email : info@smilingcoders.com

Facebook : https://www.facebook.com/Smiling-Coders-Netsuite-Training-Implementation-and-Support-1591053827660082/

Linkedin : https://www.linkedin.com/company/netsuite-academy/


Leave a Reply

Reach Us @

Linkedin
Facebook
info@smilingcoders.com
+91 7306857196