Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Validate Help - First Scripts
Apologies if this is elementary, this is my first set of scripts. Any input would be appreciated. Please ignore why my Company wants to take this route but here goes.
I've created a script to set line items when an Opportunity record is created. This seems to work as designed.
function clientPageInit(type){
for (var i = 0; i < 3; i++){
// selects the item sublist
nlapiSelectNewLineItem('item');
switch(i) {
case 0:
nlapiSetCurrentLineItemValue('item', 'item', 1712, true, true);
break;
case 1:
nlapiSetCurrentLineItemValue('item', 'item', 1713, true, true);
break;
case 2:
nlapiSetCurrentLineItemValue('item', 'item', 1714, true, true);
break;
}
// set the item, price level and amount values on the currently selected line