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.
Search Script Functions
I have been trying to get my head round the search script functions.
I have modified this code from another post and am struggling to understand exactly what everything does in order to modify it further. The filter functions are working fine, the code outputs the internal IDs of all the matching custom records.
What I am trying to achieve is also output the value of other fields such as custrecord36. Can anyone give me some guidance?
Thanks
var ContractID = nlapiGetRecordId(); var filters = new Array(); filters[0] = new nlobjSearchFilter( 'custrecord37', null, 'is', ContractID); var columns = new Array(); columns[0] = new nlobjSearchColumn( 'internalid' ); var searchresults = nlapiSearchRecord( 'customrecord25', null, filters, columns ); for (var i = 0; searchresults != null && i < searchresults.length; i++ ) { var searchresult = searchresults[ i ]; var record = searchresult.getId(); window.alert(record); } } 0