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.
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