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.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Activity search Error
Hi Guys,
I have a Scheduled SuiteScript that runs fine and I am now trying to add a function that returns the number of events attached to the lead, and I am getting the following debug + Error.
I have run the search in the UI and it returns 1 record. Any ideas?
function GetNumberofEvents(customerName) { // Build Criteria for Search var filters = new Array(); filters[0] = new nlobjSearchFilter('type', null, 'anyof', 'event'); filters[1] = new nlobjSearchFilter('company', null, 'anyof', customerName); // Return results from the Search var results = new Array(); results[0] = new nlobjSearchColumn('title'); nlapiLogExecution('DEBUG', 'Before act Search', 'customerID:' + customerName); // Execute the search var numberOfEvents = nlapiSearchRecord('activity', null, filters, results); if(numberOfEvents == null) { nlapiLogExecution('DEBUG', 'after act Search', 'number of events ' + 0); return 0; } else { nlapiLogExecution('DEBUG', 'after act Search', 'number of events ' + numberOfEvents); return parseInt(numberOfEvents); } } 0