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.
Searching for Phone Calls
Hello,
I am having a heck of a time getting this to work and I think I am missing something very simple. I need a script to run on customer save (client-side) to check if they have any scheduled phone calls and set a custom checkbox depending on the results.
The code:
customerNumber = nlapiGetRecordId(); var filters = new Array(); filters[0] = new nlobjSearchFilter('company', null, 'anyOf', customerNumber, null); filters[1] = new nlobjSearchFilter('status',null,'is','2',null); var columns = new Array(); columns[0] = new nlobjSearchColumn('startdate'); var callresults = nlapiSearchRecord('phonecall',null,filters,columns); if (callresults != null) { nlapiSetFieldValue('custentity_schedcallback','T'); } else { nlapiSetFieldValue('custentity_schedcallback','F'); } 0