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.
Script to populate invoice items
I write function which populate items to invoice on custom form 109.
When I adding new line item I have a problem.
I set all fields but field amount has bean cleaned by some script.
I suppose some ajax script triggers on item change and clean amount field.
What can I do with this?
My function.
function populateRecords() {
var entity = nlapiGetFieldValue('entity');
if (entity) {
var filters = new Array();
filters[0] = new nlobjSearchFilter( 'custrecord_cm_source', null, 'anyof', nlapiGetFieldValue('entity'));
var columns = new Array();
columns[0] = new nlobjSearchColumn( 'internalid' );
var searchresults = nlapiSearchRecord( 'customrecordcomm_rec', 'customsearch_current_payment', filters, columns);
if (searchresults != null) {
for (var h = 0; h<searchresults.length;h++) {