Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Searching especifics tasks
I need lists tasks whose status is terminated, but I dont know how. I find this in other thread but dont work...
///////////////////////********************/////////////////////////////
var filters = new Array();
filters[0] = new nlobjSearchFilter('company', null, 'is', salesOrder.getFieldValue(TRANSACTION_FIELDS.ENTITY));
filters[1] = new nlobjSearchFilter('status', null, 'noneof', new Array(TASK_STATUSES.COMPLETE));
var columns = new Array();
columns[0] = new nlobjSearchColumn('status');
columns[1] = new nlobjSearchColumn('transaction');
var results = nlapiSearchRecord(REC_IDS.TASK, null, filters, columns);
if(results != null)
{
var filteredResults = new Array();
for(var i = 0; i < results.length; i++)
{
if(results[i].getValue('transaction') == salesOrder.getId())
{
filteredResults[filteredResults.length] = results[i];
}
}
// Do stuff with the filtered results