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.
Updating Price Level field Sales Order, will attached script fail after X line items?
I have tested the attach script and it works. But before I deploy the attached script to the Sales Order, I was hoping that someone could review my script and comment to the NEGATIVE potential of the script or suggest a better optimized script. (ex. after 200 items, the script will not update line items).
Overview
Added a custom select field mirroring the (Internal ID) values of the Item Price Level Field.
Script triggers when end user selects a value from the Custom Select Field.
function setPriceLevelOverride(type, name){ if (name == 'custbody_plo') { var PriceLevel = nlapiGetFieldValue('custbody_plo'); for (var i = 1; i <= nlapiGetLineItemCount('item'); i++) { nlapiSelectLineItem('item', i); nlapiSetCurrentLineItemValue('item', 'price', PriceLevel, false, true); nlapiCommitLineItem('item'); } return false; } } 0