Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
NSC | Creating a SuiteScript Saved Search to Retrieve Customer Status
Scenario:
User wants to create a SuiteScript Saved Search to get the status of the Customer.
Solution:
We will utilize N/search module, to create a saved search. Below is a code snippet demonstrating how to achieve this:
require(['N/search'],function(search){
var soSearch = search.create({
type: search.Type.CUSTOMER,
filters: [{
name: 'companyname',
operator: search.Operator.ISNOTEMPTY
}],
columns:[{
name:'companyname'
},
{
name:'entitystatus'
}],
title: 'Status of Customer'
})
var resultSet=soSearch.run()
resultSet.each(function(result){
console.log('-----------')
console.log('Customer Name: ' + result.getValue({name:'companyname'}))
console.log('Status: ' + result.getText({name:'entitystatus'}))
console.log('-----------')
return true
})
})
Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced
----
- NetSuite Admin Corner | New to NetSuite
- Explore the NSC Webinars Category
- Join our poll and share your ideas! We want to know what you think. Don't forget to comment and make your voice heard!
- Expand your NetSuite knowledge by joining this month's Ask A Guru Live about Suitebuilder . RSVP on this event now!
0
