I'm struggling to build a simple client script that will change all price levels of items on a sales order to a level selected in a drop down box
The first item changes but then the script seems to stop at that point - so the first price level changes but doesn't commit and move to the next line
function changeDiscountLevel() { var itemcount = nlapiGetLineItemCount('item'); //select the first line item nlapiSelectLineItem('item',1); //for the line item iteration var i = 2; do { //set the current item price level to the drop down selected value (dropdown is 'custbody2') if(nlapiGetCurrentLineItemValue('item', 'price') != nlapiGetFieldValue('custbody2')) { nlapiSetCurrentLineItemValue('item', 'price', nlapiGetFieldValue('custbody2'), false,true); nlapiCommitLineItem('item'); i++; //get the next line item nlapiSelectLineItem('item',i); } } while(i <= itemcount); } }